Skip to content

Commit 762210d

Browse files
committed
Use generated token on checkout
The script `.github/update-release-branch.py` uses the `git` command to push changes. Therefore we need to ensure that `git` authenticates with a token that has the `workflows` write permision. This change restore the GitHub token used by the script to access the API and applies the `workflows` write permission to the token used by `git`.
1 parent c101242 commit 762210d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/update-release-branch.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,21 @@ jobs:
115115
SOURCE_BRANCH: ${{ needs.prepare.outputs.backport_source_branch }}
116116
TARGET_BRANCH: ${{ matrix.target_branch }}
117117
steps:
118-
- uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4
118+
- name: Generate token
119+
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4
119120
id: app-token
120121
with:
121122
app-id: ${{ vars.AUTOMATION_APP_ID }}
122123
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
123-
- uses: actions/checkout@v4
124+
125+
- name: Checkout
126+
uses: actions/checkout@v4
124127
with:
125128
fetch-depth: 0 # Need full history for calculation of diffs
129+
token: ${{ steps.app-token.outputs.token }}
126130
- uses: ./.github/actions/release-initialise
127131

128132
- name: Update older release branch
129-
env:
130-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
131133
run: |
132134
echo SOURCE_BRANCH=${SOURCE_BRANCH}
133135
echo TARGET_BRANCH=${TARGET_BRANCH}

0 commit comments

Comments
 (0)