我正在尝试在 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
[...]
您的 行动缺少 name
和 description
元素。这些是根据 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/