Skip to content

Commit 7a190bc

Browse files
committed
sync-upstream-branches: configure the workflow via vars.CONFIG
The grand idea to use GitGitGadget for projects other than Git is to allow configuring it via a custom JSON that is stored as a repository variable. Let's do this. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 36d1292 commit 7a190bc

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

.github/workflows/sync-upstream-branches.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,18 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
spec:
20-
- source-repo: j6t/git-gui
21-
target-repo: gitgitgadget/git
22-
target-ref-namespace: git-gui/
23-
- source-repo: gitster/git
24-
target-repo: gitgitgadget/git
25-
source-ref-regex: "^refs/heads/(maint-\\d|[a-z][a-z]/)"
19+
spec: ${{ fromJSON(vars.CONFIG).syncUpstreamBranches }}
2620

2721
steps:
2822
- name: check which refs need to be synchronized
2923
uses: actions/github-script@v7
3024
id: check
3125
with:
3226
script: |
33-
const sourceRepo = ${{ toJSON(matrix.spec.source-repo) }}
34-
const sourceRefRegexp = ((p) => p ? new RegExp(p) : null)(${{ toJSON(matrix.spec.source-ref-regex) }})
35-
const targetRepo = ${{ toJSON(matrix.spec.target-repo) }}
36-
const targetRefNamespace = ${{ toJSON(matrix.spec.target-ref-namespace) }}
27+
const sourceRepo = ${{ toJSON(matrix.spec.sourceRepo) }}
28+
const sourceRefRegexp = ((p) => p ? new RegExp(p) : null)(${{ toJSON(matrix.spec.sourceRefRegex) }})
29+
const targetRepo = ${{ toJSON(matrix.spec.targetRepo) }}
30+
const targetRefNamespace = ${{ toJSON(matrix.spec.targetRefNamespace) }}
3731
3832
const [targetRepoOwner, targetRepoName] = targetRepo.split('/')
3933
core.setOutput('target-repo-owner', targetRepoOwner)

0 commit comments

Comments
 (0)