Skip to content

Commit 101a9bc

Browse files
committed
ci: replace the suffix of the Docker image tag to use the GitHub short commit sha
1 parent 5a699e2 commit 101a9bc

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,10 @@ jobs:
503503
- name: Checkout
504504
uses: actions/checkout@v4
505505

506+
- name: Get short SHA
507+
id: slug
508+
run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
509+
506510
- name: Set up QEMU
507511
uses: docker/setup-qemu-action@v3
508512

@@ -523,7 +527,7 @@ jobs:
523527
images: ${{ env.REGISTRY }}/${{ env.PACKAGE }}
524528
tags: |
525529
unstable
526-
type=raw,value=${{ github.base_ref || github.ref_name }}-{{sha}}
530+
type=raw,value=${{ github.base_ref || github.ref_name }}-${{ steps.slug.outputs.sha8 }}
527531
528532
- name: Download built artifacts (Linux-X64)
529533
uses: actions/download-artifact@v4

.github/workflows/pre-release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ jobs:
130130
- name: Checkout
131131
uses: actions/checkout@v4
132132

133+
- name: Get short SHA
134+
id: slug
135+
run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
136+
133137
- name: Set up QEMU
134138
uses: docker/setup-qemu-action@v3
135139

@@ -150,7 +154,7 @@ jobs:
150154
images: ${{ env.REGISTRY }}/${{ env.PACKAGE }}
151155
tags: |
152156
pre-release
153-
type=raw,value=${{ github.ref_name }}-{{sha}}
157+
type=raw,value=${{ github.ref_name }}-${{ steps.slug.outputs.sha8 }}
154158
155159
- name: Download built artifacts (Linux-x64)
156160
uses: dawidd6/action-download-artifact@v6

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@v4
3333

34+
- name: Get short SHA
35+
id: slug
36+
run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
37+
3438
- name: Set up QEMU
3539
uses: docker/setup-qemu-action@v3
3640

@@ -51,7 +55,7 @@ jobs:
5155
images: ${{ env.REGISTRY }}/${{ env.PACKAGE }}
5256
tags: |
5357
latest
54-
type=raw,value=${{ github.ref_name }}-{{sha}}
58+
type=raw,value=${{ github.ref_name }}-${{ steps.slug.outputs.sha8 }}
5559
5660
- name: Download built artifacts (Linux-x64)
5761
uses: dawidd6/action-download-artifact@v6

0 commit comments

Comments
 (0)