Skip to content

Commit 4cdc54d

Browse files
Modify UpdateToRelease workflow for bot triggers
Add condition to skip bot-triggered events and update PR number reference. Signed-off-by: Shan Wenxiao <seanoj_noreply@yeah.net>
1 parent 817c130 commit 4cdc54d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/UpdateToRelease.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
UpdateToRelease:
1313
runs-on: ubuntu-latest
14+
# 添加条件:如果是 bot 触发的则跳过,避免无限循环
15+
if: github.event.pull_request.user.login != 'github-actions[bot]'
1416
permissions:
1517
pull-requests: write
1618
contents: write
@@ -25,7 +27,7 @@ jobs:
2527
gh pr comment ${{ github.event.pull_request.number }} --body "请向\`dev\`分支提交pull request, 本pull request将被自动关闭"
2628
gh pr close ${{ github.event.pull_request.number }}
2729
else
28-
node ./Update/UpdateToRelease.js ${{ secrets.GITHUB_TOKEN }} ${{ github.event.number }} "$PR_BODY"
30+
node ./Update/UpdateToRelease.js ${{ secrets.GITHUB_TOKEN }} ${{ github.event.pull_request.number }} "$PR_BODY"
2931
fi
3032
env:
3133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)