错误:无法解析操作“mygh/my-action@main”,未找到存储库

Dar*_*Var 10 github-actions

我在 GitHub 上有两个私有存储库。

mygh/my-action
mygh/my-code
Run Code Online (Sandbox Code Playgroud)

我正在尝试运行mygh/my-code使用自定义操作的工作流程mygh/my-action,但 GitHub Actions 失败并出现以下错误:

Failed to resolve action download info. Error: Unable to resolve action `mygh/my-action@main`, repository not found
Retrying in 12.717 seconds
Failed to resolve action download info. Error: Unable to resolve action `mygh/my-action@main`, repository not found
Retrying in 11.214 seconds
Error: Unable to resolve action `mygh/my-action@main`, repository not found
Run Code Online (Sandbox Code Playgroud)

fre*_*nky 12

操作存储库需要设置为public,至少这是目前的要求。

但是,uses不一定需要指向存储库。它还可以指向一个路径,请参阅文档。通过这种方式,您可以签出包含操作的私有存储库,或者将其放在工作流程所在的同一存储库中。


Sil*_*aze 5

如果您使用的是 GitHub Enterprise 计划,则可以使用私有存储库中的操作

在包含操作的存储库中,转至设置 > 操作 > 常规,并将访问设置更改为 可从“{org}”组织中的存储库访问可从“{enterprise}”企业中的存储库访问

在调用该操作的存储库中,您需要确保该存储库可以调用操作。设置 > 操作 > 常规,然后选择一个涵盖您想要允许的所有操作的操作权限选项。

如果您没有企业计划,那么克隆存储库并在本地调用操作(如此处所述)是目前您唯一的选择。