GitHub Action 里面提交 commit 出现 403 错误的解决办法
name: Commit
...
permissions:
# 这里必须是 write
contents: write
pages: write
id-token: write
jobs:
commit:
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: "github-actions[bot]"
author_email: "github-actions[bot]@users.noreply.github.com"
message: "Auto-sync"
add: '.'
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
项目配置中配置如图:
