ci(images): la vraie version dans le label OCI (#207)

org.opencontainers.image.version vaut X.Y.Z sur un tag et la sortie de git describe
sur main (1.5.9-11-gd5f9da6), au lieu de « latest ».

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
IliesAllaliandClaude Opus 5.5 committed 2026-11-04 16:33:25 +01:00
1 parent d5f9da6777
commit 68ab7924f2
1 file changed
+8 -2
+8 -2
View File
@@ -63,10 +63,15 @@ jobs:
with: with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }} ref: ${{ github.event.workflow_run.head_sha || github.sha }}
persist-credentials: false persist-credentials: false
# Tout l'historique et les tags, pour lire la version (git describe)
fetch-depth: 0
- name: Short commit # Version lisible dans le label OCI (#207) : 1.5.9 sur un tag, 1.5.9-11-gd5f9da6 sur main après la 1.5.9
- name: Short commit and version
id: commit id: commit
run: echo "sha=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_OUTPUT" run: |
echo "sha=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_OUTPUT"
echo "version=$(git describe --tags --match 'v*' | sed 's/^v//')" >> "$GITHUB_OUTPUT"
- uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
@@ -89,6 +94,7 @@ jobs:
type=raw,value=latest,enable=${{ github.event_name == 'workflow_run' }} type=raw,value=latest,enable=${{ github.event_name == 'workflow_run' }}
type=raw,value=sha-${{ steps.commit.outputs.sha }} type=raw,value=sha-${{ steps.commit.outputs.sha }}
labels: | labels: |
org.opencontainers.image.version=${{ steps.commit.outputs.version }}
org.opencontainers.image.revision=${{ github.event.workflow_run.head_sha || github.sha }} org.opencontainers.image.revision=${{ github.event.workflow_run.head_sha || github.sha }}
org.opencontainers.image.licenses=PolyForm-Noncommercial-1.0.0 org.opencontainers.image.licenses=PolyForm-Noncommercial-1.0.0