我正在尝试在 GitHub Actions 上使用复合运行步骤操作,如上所述here https://github.blog/changelog/2020-08-07-github-actions-composite-run-steps/#:%7E:text=You%20can%20now%20create%20reusable,reuse%20them%20for%20different%20workflows.,以便在不同的工作流程中重用它们。
但是,我收到错误:
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 提交 https://github.com/alemuntoni/meshlab/commit/fb3c3591ff93f5a49d590a735d672add38874b98 Workflow https://github.com/alemuntoni/meshlab/runs/1031019201?check_suite_focus=true
Your workflow错误地引用了操作。它正在寻找存储库build_ubuntu
用户/组织的scripts
与标签v1
.
您可以在本地引用它,因为它位于同一个存储库中。
[...]
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
[...]
Your action缺少name
and description
元素。这些都是需要的https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions.
此外,您不能使用uses
复合运行步骤中的步骤操作为webknjaz https://stackoverflow.com/users/595220/webknjaz他在评论中指出。目前您只能使用run
具有以下子元素的步骤
复合运行步骤当前支持什么?
对于复合操作中的每个运行步骤,我们支持:
- name
- id
- run
- env
- shell
- 工作目录
此外,我们支持在整个操作过程中映射输入和输出。
[...]
复合运行步骤不支持什么
我们目前不支持在复合操作中的各个步骤上设置条件、错误继续、超时分钟、“使用”和秘密。
(注意:我们确实支持在工作流程中为使用复合运行步骤操作的步骤设置这些属性)
(来源:https://github.com/actions/runner/issues/646 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...]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)