Skip to content

Commit 5214e73

Browse files
committed
ci: fix token auth for pip-compile workflow
1 parent f67e137 commit 5214e73

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/reusable-pip-compile.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ jobs:
7676
echo "branch-exists=false" >> "${GITHUB_OUTPUT}"
7777
git switch -c "${pr_branch}"
7878
fi
79-
- name: Generate temp GITHUB_TOKEN
80-
id: create_token
81-
uses: actions/create-github-app-token@v2
82-
with:
83-
app-id: ${{ secrets.BOT_APP_ID }}
84-
private-key: ${{ secrets.BOT_APP_KEY }}
85-
# We could rely on the checkout action to persist the token in the
86-
# repository config, but this way, we can prevent the previous steps
87-
# from having unnecessary access.
88-
- name: "Set up token authentication"
89-
run: gh auth setup-git --hostname github.com
9079
- name: "Run nox ${{ inputs.nox-args }}"
9180
env:
9281
# Ensure the latest pip version is used
@@ -97,6 +86,17 @@ jobs:
9786
# zizmor: ignore[template-injection]
9887
run: |
9988
nox ${{ inputs.nox-args }}
89+
- name: Generate temp GITHUB_TOKEN
90+
id: create_token
91+
uses: actions/create-github-app-token@v2
92+
with:
93+
app-id: ${{ secrets.BOT_APP_ID }}
94+
private-key: ${{ secrets.BOT_APP_KEY }}
95+
# We could rely on the checkout action to persist the token in the
96+
# repository config, but this way, we can prevent the previous steps
97+
# from having unnecessary access.
98+
- name: "Set up token authentication"
99+
run: gh auth setup-git --force --hostname github.com
100100
- name: Push new dependency versions and create a PR
101101
env:
102102
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}

0 commit comments

Comments
 (0)