Skip to content

Commit aed8d67

Browse files
Saadnajmiclaude
andcommitted
fix(ci): prevent backport update job from failing on every PR
Move the GitHub App token generation step after the backport PR lookup in the update-backport job. The lookup now uses the default github.token (which always works) and all subsequent steps are skipped when no backport PRs exist. This prevents the job from failing on every PR push due to token generation errors when there's nothing to update. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a885ae6 commit aed8d67

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/microsoft-backport.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,10 @@ jobs:
200200
contents: write
201201
pull-requests: write
202202
steps:
203-
- name: Generate GitHub App token
204-
uses: actions/create-github-app-token@v2
205-
id: app-token
206-
with:
207-
app-id: ${{ vars.APP_ID }}
208-
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
209-
210203
- name: Find linked backport PRs
211204
id: find-backports
212205
env:
213-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
206+
GH_TOKEN: ${{ github.token }}
214207
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
215208
PR_NUMBER: ${{ github.event.pull_request.number }}
216209
REPO: ${{ github.repository }}
@@ -234,6 +227,14 @@ jobs:
234227
echo "$BACKPORT_PRS" > /tmp/backport-prs.txt
235228
fi
236229
230+
- name: Generate GitHub App token
231+
if: steps.find-backports.outputs.found == 'true'
232+
uses: actions/create-github-app-token@v2
233+
id: app-token
234+
with:
235+
app-id: ${{ vars.APP_ID }}
236+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
237+
237238
- name: Checkout
238239
if: steps.find-backports.outputs.found == 'true'
239240
uses: actions/checkout@v4

0 commit comments

Comments
 (0)