Skip to content

Commit 843966d

Browse files
committed
sync-git-mailing-list-mirror: use the correct token
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 886cf74 commit 843966d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/sync-git-mailing-list-mirror.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
id: needs-update
2525
run: |
2626
set -x
27+
echo "org=${TARGET_GITHUB_REPOSITORY%%/*}" >>$GITHUB_OUTPUT &&
28+
echo "repo=${TARGET_GITHUB_REPOSITORY#*/}" >>$GITHUB_OUTPUT &&
2729
source="$(git ls-remote "$SOURCE_REPOSITORY" master)" &&
2830
target="$(git ls-remote https://github.com/"$TARGET_GITHUB_REPOSITORY" lore-$LORE_EPOCH)" &&
2931
echo "result=$(test "${source%% *}" = "${target%% *}" && echo false || echo true)" >>$GITHUB_OUTPUT
@@ -35,9 +37,18 @@ jobs:
3537
if: steps.needs-update.outputs.result == 'true'
3638
run: |
3739
git fetch "$SOURCE_REPOSITORY" refs/heads/master:refs/heads/lore-$LORE_EPOCH
40+
- name: obtain installation token
41+
if: steps.needs-update.outputs.result == 'true'
42+
uses: actions/create-github-app-token@v2
43+
id: token
44+
with:
45+
app-id: ${{ secrets.GITGITGADGET_GITHUB_APP_ID }}
46+
private-key: ${{ secrets.GITGITGADGET_GITHUB_APP_PRIVATE_KEY }}
47+
owner: ${{ steps.needs-update.outputs.org }}
48+
repositories: ${{ steps.needs-update.outputs.repo }}
3849
- name: Push to mirror
3950
if: steps.needs-update.outputs.result == 'true'
4051
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
4253
run: |
4354
git push https://$GITHUB_ACTOR:[email protected]/$TARGET_GITHUB_REPOSITORY lore-$LORE_EPOCH

0 commit comments

Comments
 (0)