diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f53e583..df24e82b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -67,13 +67,13 @@ jobs: uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: gtstef/filebrowser - - name: Remove leading 'v' from tags - id: remove-v + - name: Modify DOCKER_METADATA_OUTPUT_JSON + id: modify-json run: | - TAGS="${{ steps.meta.outputs.tags }}" - # Remove the 'v' prefix from each tag - TAGS=$(echo "$TAGS" | sed 's/^v//g') - echo "::set-output name=stripped_tags::$TAGS" + JSON="${{ steps.meta.outputs.DOCKER_METADATA_OUTPUT_JSON }}" + # Use jq to remove 'v' from the version field + JSON=$(echo "$JSON" | jq '(.tags) |= sub("filebrowser:v"; "filebrowser:")') + echo "::set-output name=modified_json::$JSON" - name: Build and push uses: docker/build-push-action@v5 with: @@ -81,5 +81,5 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 file: ./Dockerfile push: true - tags: ${{ steps.remove-v.outputs.stripped_tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + tags: ${{ steps.modify-json.outputs.modified_json | fromJSON | .tags }} + labels: ${{ steps.modify-json.outputs.modified_json | fromJSON | .labels }} \ No newline at end of file