From 3de55c9d1e0ae1df1669e03e13386d7478bed6aa Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Wed, 4 Oct 2023 09:47:18 +0300 Subject: [PATCH] make sure cnspec release works with versions containing 'v' Signed-off-by: Ivan Milchev --- .github/workflows/cnspec.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cnspec.yaml b/.github/workflows/cnspec.yaml index 8bca89f5c..04cec80e4 100644 --- a/.github/workflows/cnspec.yaml +++ b/.github/workflows/cnspec.yaml @@ -31,6 +31,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + + - name: Sanitize version input + run: | + TAG=${{ github.event.inputs.version }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx @@ -49,8 +54,8 @@ jobs: with: images: ${{ env.IMAGE }} tags: | - type=semver,pattern={{version}},value=${{ github.event.inputs.version }} - type=semver,pattern={{major}},value=${{ github.event.inputs.version }} + type=semver,pattern={{version}},value=${{ env.VERSION }} + type=semver,pattern={{major}},value=${{ env.VERSION }} type=raw,value=latest flavor: | suffix=${{ matrix.suffix }},onlatest=true @@ -61,7 +66,7 @@ jobs: with: context: . file: cnspec.Dockerfile - build-args: VERSION=${{ github.event.inputs.version }} + build-args: VERSION=${{ env.VERSION }} platforms: linux/amd64,linux/arm64,linux/arm push: true labels: ${{ steps.meta.outputs.labels }}