我希望使用Github Actions将文件推送到当前仓库。我编写了一个基本配置,使用官方
为什么GitHub Pages存储库与普通存储库不同?GitHub Pages存储库是否具有不允许推送的不同权限?
我找到的最相似的问题是如何让github actions工作流使用机器人名称将生成的文档推送到同一组织中的其他存储库。答案是使用令牌,但我认为我应该使用默认令牌。
actions/checkout@v3
操作。我的配置与 readme示例 几乎相同。name: Example
on: workflow_dispatch
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- shell: bash
run: |
date > 1.txt
git config user.name github-actions
git config user.email github-actions@github.com
git add 1.txt
git commit -m updated
git push
这个配置对于任何仓库都有效,除了 Github Pages 仓库。错误信息如下:
remote: Permission to sirekanian/sirekanian.github.io.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/sirekanian/sirekanian.github.io/': The requested URL returned error: 403
Error: Process completed with exit code 128.
为什么GitHub Pages存储库与普通存储库不同?GitHub Pages存储库是否具有不允许推送的不同权限?
我找到的最相似的问题是如何让github actions工作流使用机器人名称将生成的文档推送到同一组织中的其他存储库。答案是使用令牌,但我认为我应该使用默认令牌。
content
(其中包括标签)。因此,我建议使用其他答案来设置permissions
。 - undefined