Composite Run Steps GitHub Actions错误:“在URI上找不到操作”

时间:2020-08-26 11:11:20

标签: github github-actions

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

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

1 个答案:

答案 0 :(得分:3)

您的工作流程错误地引用了该操作。它正在寻找标签为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所必需的。

此外,您不能在webknjaz的评论中提到的复合运行步骤操作中使用uses步骤。当前,您只能对以下子元素使用run步骤

复合运行步骤当前支持什么?

对于复合操作中的每个运行步骤,我们都支持:

  • 名称
  • id
  • 运行
  • env
  • 工作目录

此外,我们支持在整个动作中映射输入和输出。
[...]

复合运行步骤不支持什么

我们现在不支持在复合操作中的各个步骤上设置条件,错误继续,超时分钟,“使用”和秘密。

(注意:我们确实支持在工作流程中为使用复合运行步骤操作的步骤设置这些属性)

(来源: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...]