From 68ab7924f2f960cb14a5d95e76d96044d523e6b1 Mon Sep 17 00:00:00 2001 From: IliesAllali Date: Wed, 4 Nov 2026 16:33:25 +0100 Subject: [PATCH] ci(images): la vraie version dans le label OCI (#207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/images.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 7a1e0d2..06efdc8 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -63,10 +63,15 @@ jobs: with: ref: ${{ github.event.workflow_run.head_sha || github.sha }} 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 - 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 @@ -89,6 +94,7 @@ jobs: type=raw,value=latest,enable=${{ github.event_name == 'workflow_run' }} type=raw,value=sha-${{ steps.commit.outputs.sha }} labels: | + org.opencontainers.image.version=${{ steps.commit.outputs.version }} org.opencontainers.image.revision=${{ github.event.workflow_run.head_sha || github.sha }} org.opencontainers.image.licenses=PolyForm-Noncommercial-1.0.0