我正在尝试在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
答案 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
[...]
您的操作缺少name
和description
元素。这些是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...]