fix(ci): fallback to github.sha in case of tag

tag pushes couldn't compute the hash using the git command
This commit is contained in:
youben11
2023-04-05 16:42:44 +01:00
committed by Ayoub Benaissa
parent d435ccdd6c
commit 1bcf53f2da

View File

@@ -48,7 +48,7 @@ jobs:
- name: Start AWS job in Slab
shell: bash
run: |
GIT_SHA="$(git --no-pager show -s --format="%H" origin/${{ env.GIT_REF }})"
GIT_SHA="$(git --no-pager show -s --format="%H" origin/${{ env.GIT_REF }})" || GIT_SHA=${{ github.sha }}
echo -n '{"command": "${{ inputs.command }}", "git_ref": "${{ env.GIT_REF }}", "sha":"'${GIT_SHA}'", "user_inputs": "${{ inputs.user_inputs }}"}' > command.json
cat command.json
SIGNATURE="$(slab/scripts/hmac_calculator.sh command.json '${{ secrets.JOB_SECRET }}')"