From 762210d5a082a9bf9c7e61975a246fcc808068de Mon Sep 17 00:00:00 2001 From: Remco Vermeulen Date: Fri, 13 Sep 2024 09:13:54 -0700 Subject: [PATCH] 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`. --- .github/workflows/update-release-branch.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-release-branch.yml b/.github/workflows/update-release-branch.yml index c823a38c2..7b6f31c26 100644 --- a/.github/workflows/update-release-branch.yml +++ b/.github/workflows/update-release-branch.yml @@ -115,19 +115,21 @@ jobs: SOURCE_BRANCH: ${{ needs.prepare.outputs.backport_source_branch }} TARGET_BRANCH: ${{ matrix.target_branch }} steps: - - uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 + - name: Generate token + uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 id: app-token with: app-id: ${{ vars.AUTOMATION_APP_ID }} private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }} - - uses: actions/checkout@v4 + + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 # Need full history for calculation of diffs + token: ${{ steps.app-token.outputs.token }} - uses: ./.github/actions/release-initialise - name: Update older release branch - env: - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} run: | echo SOURCE_BRANCH=${SOURCE_BRANCH} echo TARGET_BRANCH=${TARGET_BRANCH}