diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c973ab409..6445bafd3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,8 @@ name: Release on: push: tags: - - "v*" + - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-*" permissions: contents: write @@ -17,6 +18,15 @@ jobs: with: fetch-depth: 0 + - name: Validate tag name + run: | + tag="${GITHUB_REF_NAME}" + echo "Triggered by tag: $tag" + if [[ "$tag" == *-dirty* ]]; then + echo "::error::Refusing to release from dirty tag '$tag'." + exit 1 + fi + - name: Setup Go uses: actions/setup-go@v5 with: