Skip to content

Commit 54d39cf

Browse files
Update GitHub Actions workflow to skip bot triggers
Signed-off-by: Shan Wenxiao <seanoj_noreply@yeah.net>
1 parent dfe8cf8 commit 54d39cf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/UpdateToRelease.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ 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
1719
steps:
18-
- uses: actions/checkout@v5
20+
- uses: actions/checkout@v6
1921
with:
2022
fetch-depth: 0
2123
- name: Update to release
@@ -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)