From 97db2957ee02f16664753ebad6cf1c05e4bd955a Mon Sep 17 00:00:00 2001 From: mitulshah-suse Date: Thu, 11 Jul 2024 12:07:14 +0530 Subject: [PATCH] Fix token for PR generation for CI invocation --- .github/workflows/git-actions-go-generate.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/git-actions-go-generate.yml b/.github/workflows/git-actions-go-generate.yml index 3701510c..3d653fea 100644 --- a/.github/workflows/git-actions-go-generate.yml +++ b/.github/workflows/git-actions-go-generate.yml @@ -16,6 +16,7 @@ env: permissions: contents: write pull-requests: write + id-token: write jobs: go-generate: runs-on: ubuntu-latest @@ -45,6 +46,11 @@ jobs: git checkout -b "$BRANCH" git commit -a -m 'go generate' git push origin "$BRANCH" + - name: Retrieve token from vault + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/github-token/credentials token | PAT_TOKEN ; - name: Create Pull Request if: ${{ env.changes_exist == 'true' }} id: cpr @@ -52,7 +58,7 @@ jobs: env: SOURCE_BRANCH: ${{ steps.branch.outputs.branch }} with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ env.PAT_TOKEN }} script: | let body = 'Auto-generated by GitHub Actions\n\n' if ( `${ process.env.INPUT_SOURCE_URL }` ) {