Skip to content

Commit 05eed3e

Browse files
anweshadasgotmax23
andauthored
Fixes #2830 uses actions/create-github-app-token@v2 (#2831)
* Fixes #2830 uses actions/create-github-app-token@v2 * Adds github-bot as environment in the job config * Remove extraneous newline --------- Co-authored-by: Maxwell G <[email protected]>
1 parent 768ed19 commit 05eed3e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/release-porting-guide.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
upload-porting-guide:
1818
name: Extract the porting guide
1919
runs-on: ubuntu-latest
20+
environment: github-bot
2021
env:
2122
GIT_BRANCH: "release/porting-guide-${{ inputs.ansible-version }}"
2223
ANSIBLE_VERSION_FULL: ${{ inputs.ansible-version }}
@@ -28,8 +29,18 @@ jobs:
2829
run: echo "ANSIBLE_VERSION_MAJOR=${ANSIBLE_VERSION_FULL%%.*}" >> "${GITHUB_ENV}"
2930
shell: bash --noprofile --norc -O extglob -eEuo pipefail {0}
3031

32+
- name: Generate temp GITHUB_TOKEN
33+
id: create_token
34+
uses: actions/create-github-app-token@v2
35+
with:
36+
app-id: ${{ secrets.BOT_APP_ID }} # From github-bot environment
37+
private-key: ${{ secrets.BOT_APP_KEY }} # From github-bot environment
38+
3139
- name: Check out this repo src
3240
uses: actions/checkout@v4
41+
with:
42+
token: ${{ steps.create_token.outputs.token }}
43+
3344
- name: Check out ansible-build-data
3445
uses: actions/checkout@v4
3546
with:
@@ -59,11 +70,13 @@ jobs:
5970
git commit -m "${CI_COMMIT_MESSAGE}"
6071
6172
- name: Push to the repo
73+
env:
74+
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
6275
run: git push origin "${GIT_BRANCH}"
6376

6477
- name: Create the porting guide PR as draft
6578
env:
66-
GITHUB_TOKEN: ${{ github.token }}
79+
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
6780
PR_BODY_MESSAGE: |-
6881
##### SUMMARY
6982

0 commit comments

Comments
 (0)