A: 在通过github action修改仓库时 遇到"refusing to allow a GitHub App to create or update workflow .github/workflows/rating-chart.yml without workflows permission"报错
GitHub automatically creates a GITHUB_TOKEN secret to use in your workflow. You can use the GITHUB_TOKEN to authenticate in a workflow run.
When you enable GitHub Actions, GitHub installs a GitHub App on your repository. The GITHUB_TOKEN secret is a GitHub App installation access token. You can use the installation access token to authenticate on behalf of the GitHub App installed on your repository. The token's permissions are limited to the repository that contains your workflow. For more information, see "Permissions for the GITHUB_TOKEN."
If you need a token that requires permissions that aren't available in the GITHUB_TOKEN, you can create a personal access token and set it as a secret in your repository:
Use or create a token with the appropriate permissions for that repository. For more information, see "Creating a personal access token."
A: 在通过github action修改仓库时 遇到"refusing to allow a GitHub App to create or update workflow
.github/workflows/rating-chart.yml
withoutworkflows
permission"报错Q: 根据提示可知, GitHub App 没有
workflow
权限.github action
有操作仓库.github/workflows/*
的动作;github action
的授权操作可能只用了默认的${{ secrets.GITHUB_TOKEN }}
或者没有赋予workflow
权限的个人令牌, 而该GITHUB_TOKEN
或个人令牌存在权限问题, 先来看一下官方对GITHUB_TOKEN
的用法和权限说明解决办法:
此处需要额外勾选
workflow
权限, 才能操作.github/workflows/*
类似案例: