Skip to content

Commit f6ab6bf

Browse files
ci: use gh app to generate token rather than classic token (#35)
* ci: use gh app to generate token rather than classic token * ci: remove permfix (internal)
1 parent 589a544 commit f6ab6bf

1 file changed

Lines changed: 40 additions & 4 deletions

File tree

.github/workflows/sync-forks.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ permissions:
1212
contents: write
1313

1414
env:
15-
# Token must be created by someone with write access for all forks.
16-
# Be sure to 'configure SSO' from the token creation page for each fork organization.
17-
GH_TOKEN: ${{ secrets.SYNC_FORK_TOKEN }}
1815
UPSTREAM_OWNER: CCBR
1916

2017
jobs:
@@ -42,7 +39,6 @@ jobs:
4239
- l2p
4340
- METRO
4441
- MAAPSTER
45-
- permfix
4642
- pyrkit
4743
- rNA
4844
- SINCLAIR
@@ -51,7 +47,17 @@ jobs:
5147
- MAPLE
5248
- LOGAN
5349
steps:
50+
- name: Generate a token
51+
id: generate-token
52+
uses: actions/create-github-app-token@v2
53+
with:
54+
app-id: ${{ vars.CCBR_BOT_APP_ID }}
55+
private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }}
56+
owner: ${{ matrix.FORK_OWNER }}
57+
5458
- name: sync forked repos
59+
env:
60+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
5561
run: |
5662
gh repo sync ${{ matrix.FORK_OWNER }}/${{ matrix.REPO }} --source $UPSTREAM_OWNER/${{ matrix.REPO }} --force
5763
@@ -63,7 +69,17 @@ jobs:
6369
FORK_OWNER: [NCIPangea]
6470
REPO: [ASPEN, CARLISLE, CHAMPAGNE, CRISPIN, RENEE, XAVIER]
6571
steps:
72+
- name: Generate a token
73+
id: generate-token
74+
uses: actions/create-github-app-token@v2
75+
with:
76+
app-id: ${{ vars.CCBR_BOT_APP_ID }}
77+
private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }}
78+
owner: ${{ matrix.FORK_OWNER }}
79+
6680
- name: sync forked repos
81+
env:
82+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
6783
run: |
6884
gh repo sync ${{ matrix.FORK_OWNER }}/${{ matrix.REPO }} --source $UPSTREAM_OWNER/${{ matrix.REPO }} --force
6985
@@ -83,7 +99,17 @@ jobs:
8399
- DSP_Analysis
84100

85101
steps:
102+
- name: Generate a token
103+
id: generate-token
104+
uses: actions/create-github-app-token@v2
105+
with:
106+
app-id: ${{ vars.CCBR_BOT_APP_ID }}
107+
private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }}
108+
owner: ${{ matrix.FORK_OWNER }}
109+
86110
- name: sync forked repos
111+
env:
112+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
87113
run: |
88114
gh repo sync ${{ matrix.FORK_OWNER }}/${{ matrix.REPO }} --source $UPSTREAM_OWNER/${{ matrix.REPO }} --force
89115
@@ -103,6 +129,16 @@ jobs:
103129
UPSTREAM_OWNER: NCI-CCDI
104130
FORK_OWNER: abcsFrederick
105131
steps:
132+
- name: Generate a token
133+
id: generate-token
134+
uses: actions/create-github-app-token@v2
135+
with:
136+
app-id: ${{ vars.CCBR_BOT_APP_ID }}
137+
private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }}
138+
owner: ${{ matrix.FORK_OWNER }}
139+
106140
- name: sync forked repos
141+
env:
142+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
107143
run: |
108144
gh repo sync ${{ matrix.FORK_OWNER }}/${{ matrix.REPO }} --source ${{matrix.UPSTREAM_OWNER}}/${{ matrix.REPO }} --force

0 commit comments

Comments
 (0)