使用 actions/checkout@v4 在自托管运行器上克隆私有存储库时出现存储库未找到错误

问题描述 投票:0回答:1

我尝试使用

actions/checkout@v4
在我的自托管运行器上查看我的私人存储库,但出现此错误:

ERROR: Repository not found.
Error: The process bin/git failed with exit code 128
...Please ensure that the correct permissions exist...

这是我的工作流程:

name: 'some job'

on:
  push:
    branches:
      - main

jobs:
  some-job:
    runs-on: ['self-hosted']
    steps:
      - name: 'Checkout Service'
        uses: actions/checkout@v4
        with:
          repository: "some-name/test"
          path: test
          token: "<here is my token>"
          ref: main

我的考虑:

调用了自托管运行器。分支

main
存在。令牌已正确插入。个人访问令牌 (PAT) 是使用我的 GitHub 帐户在开发者设置中创建的。我使用 git CLI 验证了令牌。该令牌有权签出我的私人存储库。这可能与我的自托管运行程序有关?还有什么我需要考虑的吗?我还尝试检查一个公共存储库,它按预期工作以排除其他问题。

github-actions
1个回答
0
投票

添加:

steps:
    - name: Setup self-hosted runner access
      run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner_work/some-name/test

参考:https://github.com/valkey-io/valkey-glide/blob/main/.github/workflows/npm-cd.yml#L77

© www.soinside.com 2019 - 2024. All rights reserved.