Skip to content

Commit 3912bfe

Browse files
committed
[ci][fix] Tag image with short commitID
1 parent ad02303 commit 3912bfe

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/ci_rocky8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
echo "$branchName" > branch_name.txt
8282
8383
commitId="${{ github.sha }}"
84-
shortCommitId=${commitId:0:8}
84+
shortCommitId=${commitId:0:7}
8585
echo "commit id is: $shortCommitId"
8686
echo "$shortCommitId" > commit_id.txt
8787

.github/workflows/release-dockerhub.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ jobs:
135135
type=raw,enable=${{ env.EVENT == 'tag' }},value=${{ env.TAG_NAME }}
136136
type=raw,value=latest,enable=${{ env.BRANCH_NAME == 'main' && env.EVENT != 'tag'}}
137137
type=sha,prefix=,format=short,enable=${{ env.BRANCH_NAME == 'main' && env.EVENT != 'tag' }}
138-
type=sha,prefix=${{ env.BRANCH_NAME }}-,format=short,enable=${{ env.EVENT != 'tag' && env.BRANCH_NAME != 'main' }}
138+
type=raw,value=${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }},enable=${{ env.EVENT != 'tag' && env.BRANCH_NAME != 'main' }}
139+
type=raw,value=${{ env.BRANCH_NAME }}-latest,enable=${{ env.EVENT != 'tag' && env.BRANCH_NAME != 'main' }}
139140
140141
- name: Build image and push to Docker Hub and GitHub Container Registry
141142
if: steps.check-event.outputs.continue == 'true'

0 commit comments

Comments
 (0)