File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1010jobs :
1111 summarize :
1212 runs-on : ubuntu-latest
13+ permissions :
14+ contents : write
1315 steps :
1416 - uses : actions/checkout@v4
1517 with :
1618 fetch-depth : 0
19+ token : ${{ secrets.GITHUB_TOKEN }}
1720
1821 - name : Setup Node.js
1922 uses : actions/setup-node@v4
@@ -157,9 +160,11 @@ jobs:
157160 node analyze-commit.js
158161
159162 - name : Commit and Push Summary
163+ env :
164+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
160165 run : |
161- git config user.name "github-actions"
162- git config user.email "actions@ github.com"
166+ git config user.name "github-actions[bot] "
167+ git config user.email "41898282+github- actions[bot]@users.noreply. github.com"
163168
164169 # 检查是否有变更需要提交
165170 if [[ -f "notes-react/commit_summary.md" ]]; then
@@ -169,6 +174,9 @@ jobs:
169174 COMMIT_HASH=$(git rev-parse HEAD | cut -c1-8)
170175 COMMIT_MSG=$(git log -1 --pretty=%s)
171176 git commit -m "📝 React源码学习: ${COMMIT_MSG} (${COMMIT_HASH}) [skip ci]"
177+
178+ # 使用 GITHUB_TOKEN 推送
179+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
172180 git push
173181 echo "✅ Commit summary updated and pushed"
174182 else
You can’t perform that action at this time.
0 commit comments