I am following this.
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 }}
This works fine but multiple-step makes the workflow bigger. I was trying something more compact.
like determining the commit SHA in env.
env:
COMMIT_HASH: ${{ github.event.inputs.git-ref != '' && github.event.inputs.git-ref || github.sha }}
this works fine but looks like a ugly hack to me. any suggestions. I am trying to avoid extra steps,tha's all.