Skip to content

Commit 332f456

Browse files
authored
Update update-links.yml
1 parent 3f14fcb commit 332f456

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/update-links.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Update Share Links
33
on:
44
push:
55
paths:
6-
- "*.scripting" # 根目录
7-
- "**/*.scripting" # 子目录
6+
- "*.scripting"
7+
- "**/*.scripting"
88
branches:
99
- main
10-
workflow_dispatch: # 支持手动触发
10+
workflow_dispatch:
1111

1212
jobs:
1313
build:
@@ -33,7 +33,8 @@ jobs:
3333
git config user.name "${GITHUB_ACTOR}"
3434
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
3535
git add README.md
36-
git commit -m "chore: auto update share links" || echo "No changes"
37-
git push
36+
git diff-index --quiet HEAD || git commit -m "chore: auto update share links"
37+
# 使用 token 进行推送
38+
git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git" HEAD:main
3839
env:
3940
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)