File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Deploy
2- run-name : Deploy to ${{ inputs.environment }}
2+ run-name : Deploy ${{ inputs.git_tag || github.ref_name }} to ${{ inputs.environment }}
33
44concurrency :
55 group : deploy-${{ inputs.environment }}
@@ -47,16 +47,21 @@ jobs:
4747 outputs :
4848 git-sha : ${{ steps.get-git-sha.outputs.git-sha }}
4949 steps :
50- - name : Get git sha
51- id : get-git-sha
52- run : |
53- if [ -z "${{ inputs.git_tag }}" ]; then
54- echo "No git tag provided. Using the latest commit sha"
55- echo "git-sha=${{ github.sha }}" >> $GITHUB_OUTPUT
56- else
57- echo "Git tag provided. Using the sha of the tagged commit"
58- echo "git-sha=$(git rev-parse ${{ inputs.git_tag }})" >> $GITHUB_OUTPUT
59- fi
50+ - name : Checkout code
51+ uses : actions/checkout@v4
52+ with :
53+ ref : ${{ inputs.git_tag || github.sha }}
54+ - name : Get git sha
55+ id : get-git-sha
56+ run : |
57+ if [ -z "${{ inputs.git_tag }}" ]; then
58+ echo "No git tag provided. Using the latest commit sha"
59+ echo "git-sha=${{ github.sha }}" >> $GITHUB_OUTPUT
60+ else
61+ git_sha=$(git rev-parse refs/tags/${{ inputs.git_tag }})
62+ echo "Git tag provided. Using the sha of the tagged commit: $git_sha"
63+ echo "git-sha=$git_ssha" >> $GITHUB_OUTPUT
64+ fi
6065 build-and-push-image :
6166 needs : determine-git-sha
6267 uses : ./.github/workflows/build-and-push-image.yml
You can’t perform that action at this time.
0 commit comments