mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-16 19:29:26 +02:00
ci(release): restrict tag pattern to semver and reject -dirty tags (#1280)
The release workflow previously triggered on 'v*', which matched a stray 'v0.2.5-dirty' tag pushed to the repository. GoReleaser ran again and overwrote the Homebrew formula with a 0.2.5-dirty version whose tarball URLs 404. Tighten the trigger to semver-shaped tags and add an explicit guard that fails the job if the tag name contains '-dirty' (which can come from 'git describe --tags --dirty'). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user