Skip to content

Commit 6ce29b2

Browse files
authored
ci: 🐛 syncing workflow needs extra settings (#71)
## Description Hopefully this works now.
1 parent fdb0a8f commit 6ce29b2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/sync-files.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- uses: actions/create-github-app-token@v2
1313
id: app-token
1414
with:
15+
owner: ${{ github.repository_owner }}
1516
app-id: ${{ vars.SYNC_FILES_APP_ID }}
1617
private-key: ${{ secrets.SYNC_FILES_TOKEN }}
1718

@@ -20,14 +21,21 @@ jobs:
2021
with:
2122
token: ${{ steps.app-token.outputs.token }}
2223

24+
# Taken from https://github.com/actions/create-github-app-token/
25+
- name: Get GitHub App User ID
26+
id: get-user-id
27+
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
28+
env:
29+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
30+
2331
- name: Run GitHub File Sync
2432
uses: BetaHuhn/repo-file-sync-action@v1
2533
with:
2634
GH_INSTALLATION_TOKEN: ${{ steps.app-token.outputs.token }}
2735
ASSIGNEES: lwjohnst86
2836
IS_FINE_GRAINED: true
29-
GIT_USERNAME: github-actions[bot]
30-
GIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
37+
GIT_USERNAME: ${{ steps.app-token.outputs.app-slug }}[bot]
38+
GIT_EMAIL: ${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com
3139
COMMIT_PREFIX: "chore(sync): :hammer: "
3240
BRANCH_PREFIX: chore
3341
TEAM_REVIEWERS: admin

0 commit comments

Comments
 (0)