仓库是私有仓库,创建了个 Github Actions 用于从国外自动 fetch 一些配置文件到仓库内,不过无论如何都没法 Push 上去,提示没有写权限。
Github Actions YAML:
- name: Commit & Push changes uses: actions-js/[email protected] with: github_token: ${{ secrets.REPOKEY }} message: "update data" author_email: 'xxx' author_name: 'LxnChan'
REPOKEY
在仓库的 Settings 中有正确创建,该 Token 类型为 Classic ,已有的权限有admin:repo_hook, repo, workflow
,永不过期。
报错:
解决了,在仓库Settings-Actions-General-Workflow permissions,选择Read and write permissions
不知道为啥还整个这个选项,这不跟Token创建的时候的权限选择冲突了嘛
1 arvin01 2023-03-11 22:04:35 +08:00 `github_token` 这里直接用 `${{ secrets.GITHUB_TOKEN }}` 试试? |
3 Ggmusic 2023-03-11 22:43:01 +08:00 via iPhone ![]() LxnChan 不用你建,actions 自动生成,但是需要在 settings - Actions-workflow permissions 里设置下权限,改成 read and write 。 |