V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
LxnChan
V2EX  ›  GitHub

求助: Github Actions 无法 Push 到仓库

  •  
  •   LxnChan ·
    lxnchan · Mar 11, 2023 · 1643 views
    This topic created in 1149 days ago, the information mentioned may be changed or developed.

    仓库是私有仓库,创建了个 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,永不过期。

    报错:

    Supplement 1  ·  Mar 11, 2023

    解决了,在仓库Settings-Actions-General-Workflow permissions,选择Read and write permissions

    不知道为啥还整个这个选项,这不跟Token创建的时候的权限选择冲突了嘛

    4 replies    2023-03-11 22:45:05 +08:00
    arvin01
        1
    arvin01  
       Mar 11, 2023
    `github_token` 这里直接用 `${{ secrets.GITHUB_TOKEN }}` 试试?
    LxnChan
        2
    LxnChan  
    OP
       Mar 11, 2023
    @arvin01 创建不了以 GITHUB_开头的 secrets
    Ggmusic
        3
    Ggmusic  
       Mar 11, 2023 via iPhone   ❤️ 1
    @LxnChan 不用你建,actions 自动生成,但是需要在 settings - Actions-workflow permissions 里设置下权限,改成 read and write 。
    LxnChan
        4
    LxnChan  
    OP
       Mar 11, 2023
    @Ggmusic 才发现🤣
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   781 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 21:37 · PVG 05:37 · LAX 14:37 · JFK 17:37
    ♥ Do have faith in what you're doing.