File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 77 version :
88 required : false
99 type : string
10+ commit_sha :
11+ required : false
12+ type : string
1013
1114env :
1215 ECR_REPOSITORY : " provider-sample-url-finder"
1922 steps :
2023 - name : Checkout code
2124 uses : actions/checkout@v4
25+ with :
26+ ref : ${{ inputs.commit_sha }}
2227
2328 - name : Set up Docker Buildx
2429 uses : docker/setup-buildx-action@v3
Original file line number Diff line number Diff line change 2626 runs-on : ubuntu-latest
2727 needs : code-check
2828 if : ${{ github.ref_name == 'main' && inputs.version != '' }}
29+ outputs :
30+ commit_sha : ${{ steps.commit-version.outputs.commit_sha }}
2931
3032 steps :
3133 - name : Checkout code
4648 git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
4749
4850 - name : Commit version change
51+ id : commit-version
4952 run : |
5053 git commit -am "Update version to ${{ inputs.version }}"
5154 git push origin main
55+ echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
5256
5357 build-and-publish :
5458 needs :
6165 uses : ./.github/workflows/build-docker-image.yml
6266 with :
6367 version : ${{ inputs.version }}
68+ commit_sha : ${{ github.ref_name == 'main' && inputs.version != '' && needs.bump-version.outputs.commit_sha || '' }}
6469 secrets : inherit
6570
6671 git-tag :
7479 steps :
7580 - name : Checkout code
7681 uses : actions/checkout@v4
82+ with :
83+ ref : ${{ needs.bump-version.outputs.commit_sha }}
7784
7885 - name : Create and push tag
7986 run : |
You can’t perform that action at this time.
0 commit comments