github - 复合运行步骤 GitHub 操作错误 : 'An action could not be found at the URI'

标签 github github-actions

我正在尝试在 GitHub 操作上使用复合运行步骤操作,如 here 所述,以便在不同的工作流程中重用它们。
但是,我收到错误:

An action could not be found at the URI 'https://api.github.com/repos/scripts/build_ubuntu/tarball/v1
我的主要工作流程( .github/workflows/BuildUbuntu.yml )如下:
[...]

jobs:
  ubuntu_build_appimage:
    name: Build MeshLab (Ubuntu - AppImage)
    runs-on: ubuntu-16.04

    steps:
    - uses: scripts/build_ubuntu@v1

[...]
复合步骤( .github/workflows/scripts/build_ubuntu/action.yml )如下:
runs:
  using: "composite"
  steps: 
  - uses: actions/checkout@v2
    with:
      submodules: true

  [other steps...]
我究竟做错了什么?
以下是链接:
GitHub Commit Workflow

最佳答案

您的 工作流程 错误地引用了该操作。它正在寻找存储库 build_ubuntu用户/组织的scripts带标签 v1 .
您可以在本地引用它,因为它在同一个存储库中。

[...]

jobs:
  ubuntu_build_appimage:
    name: Build MeshLab (Ubuntu - AppImage)
    runs-on: ubuntu-16.04

    steps:
    - uses: ./.github/workflows/scripts/build_ubuntu

[...]
您的 行动缺少 namedescription元素。这些是根据 https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions 所必需的.
此外,您不能使用 uses复合运行步骤操作中的步骤为 webknjaz在他的评论中指出。目前您只能使用 run具有以下子元素的步骤

What does composite run steps currently support?

For each run step in a composite action, we support:

  • name
  • id
  • run
  • env
  • shell
  • working-directory

In addition, we support mapping input and outputs throughout the action.
[...]

What does Composite Run Steps Not Support

We don't support setting conditionals, continue-on-error, timeout-minutes, "uses", and secrets on individual steps within a composite action right now.

(Note: we do support these attributes being set in workflows for a step that uses a composite run steps action)


(来源:https://github.com/actions/runner/issues/646)
name: "My composite action"
description: "Execute some run setps to do something"
runs:
  using: "composite"
  steps: 
  - run: |
      echo do something
      echo and do something else

  [other steps...]

关于github - 复合运行步骤 GitHub 操作错误 : 'An action could not be found at the URI' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63596379/

相关文章:

git - 使用静态站点生成器创建网站时如何将博客文章分离到另一个 git 存储库中?

docker - 从 Github Actions 上的 package.json 安装私有(private) github 包

ruby - GitHub Action 安装 gem 失败

amazon-web-services - 如何优雅地取消 cdk 部署?

rest - 如何通过 REST API 从 Bamboo Atlassian 构建计划中检索我的自定义变量

Git 日志在 GitHub 上提交与 merge 时显示不同的作者电子邮件

github - 无法在 Github 中为存储库或文件加注星标

azure - 将 Azure 存储帐户中的文件夹复制到同一存储帐户中的另一个文件夹

github - 使用 POST 请求触发 Github Action (Github REST API)

git - 如何将我的项目重新连接到我现有的 GitHub 存储库