【问题标题】:Composite Run Steps GitHub Actions error: 'An action could not be found at the URI'复合运行步骤 GitHub 操作错误:“在 URI 上找不到操作”
【发布时间】:2020-12-15 04:19:01
【问题描述】:

我正在尝试在 GitHub Actions 上使用复合运行步骤操作,如 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 CommitWorkflow

【问题讨论】:

    标签: github github-actions


    【解决方案1】:

    您的工作流程 引用的操作不正确。它正在寻找带有标签v1 的用户/组织scripts 的存储库build_ubuntu

    您可以在本地引用它,因为它在同一个存储库中。

    [...]
    
    jobs:
      ubuntu_build_appimage:
        name: Build MeshLab (Ubuntu - AppImage)
        runs-on: ubuntu-16.04
    
        steps:
        - uses: actions/checkout@v2
        - uses: ./.github/workflows/scripts/build_ubuntu
    
    [...]
    

    您的action 缺少namedescription 元素。根据https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions,这些是必需的。

    此外,您不能在复合运行步骤操作中使用uses 步骤,正如webknjaz 在他的评论中指出的那样。目前您只能将run 步骤与以下子元素一起使用

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

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

    • 姓名
    • 身份证
    • 运行
    • 环境
    • 外壳
    • 工作目录

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

    复合运行步骤不支持什么

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

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

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

    【讨论】:

    猜你喜欢
    • 2020-09-19
    • 2020-12-07
    • 2020-01-16
    • 2021-05-27
    • 2021-11-16
    • 2021-11-02
    • 2022-06-13
    • 2019-08-02
    • 1970-01-01
    相关资源
    最近更新 更多