【发布时间】:2021-05-28 03:09:42
【问题描述】:
我正在关注这个。
https://github.community/t/github-actions-manual-trigger-approvals/16233/83
- name: Clone Repository (Latest)
uses: actions/checkout@v2
if: github.event.inputs.git-ref == ''
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v2
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
这工作正常,但多步骤使工作流程更大。 我正在尝试更紧凑的东西。
就像在 env 中确定提交 SHA。
env:
COMMIT_HASH: ${{ github.event.inputs.git-ref != '' && github.event.inputs.git-ref || github.sha }}
这工作正常,但对我来说看起来像一个丑陋的黑客。有什么建议么。 我试图避免额外的步骤,仅此而已。
【问题讨论】:
标签: github-actions