File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ jobs:
3737
3838 - name : Auto Label PR
393940+ env :
41+ PR_NUMBER : ${{ github.event.inputs.pr_number || github.event.number }}
4042 with :
4143 github-token : ${{ steps.generate-token.outputs.token }}
4244 script : |
4345 const { owner, repo } = context.repo;
44- const pr_number = github.event_name === 'workflow_dispatch'
45- ? ${{ github.event.inputs.pr_number }}
46- : context.issue.number;
46+ const pr_number = parseInt(process.env.PR_NUMBER);
4747
4848 console.log('Processing PR #' + pr_number);
4949
7474
7575 // Strategy: Branch-based labeling
7676 let baseRef, prBody;
77- if (github.event_name === 'workflow_dispatch' ) {
77+ if (process.env.PR_NUMBER !== context.issue.number.toString() ) {
7878 // Get PR details when called via workflow_dispatch
7979 const { data: pr } = await github.rest.pulls.get({
8080 owner,
@@ -199,7 +199,7 @@ jobs:
199199 // Find the most recent review from this bot that requested changes for wrong base branch
200200 const botReview = reviews
201201 .filter(review =>
202- review.user.login === '${{ env.BOT_NAME }}' &&
202+ review.user.login === process. env.BOT_NAME &&
203203 review.state === 'CHANGES_REQUESTED' &&
204204 review.body && review.body.includes('target your PR to the `next` branch')
205205 )
Original file line number Diff line number Diff line change 2828 workflow_id: 'auto-label-pr.yml',
2929 ref: context.payload.pull_request.base.ref,
3030 inputs: {
31- pr_number: context.payload.pull_request.number
31+ pr_number: context.payload.pull_request.number.toString()
3232 }
3333 });
You can’t perform that action at this time.
0 commit comments