Skip to content

Commit f348b2d

Browse files
jimisolaCopilot
andcommitted
fix: fix check_release workflow to actually validate releases
- Was a no-op: 'push' event never fires when called via workflow_call from release - Validate bare semver tag format (e.g. 1.2.3, not v1.2.3) - Validate release targets main, hotfix/*, or release/* branch Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b8bd42e commit f348b2d

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
name: Lint (black and flake8)
1+
name: Check Release
22
on:
33
workflow_call:
44

55
jobs:
66
check-release:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Check branch and tag
10-
if: github.event_name == 'push' && !(github.ref == 'refs/heads/main' && startsWith(github.ref, 'refs/tags/v'))
11-
run: exit 1
9+
- name: Check tag format
10+
run: |
11+
if ! echo "${{ github.ref }}" | grep -qE '^refs/tags/[0-9]+\.[0-9]+\.[0-9]+'; then
12+
echo "Tag must be a semver version like 1.2.3 (no v prefix)"
13+
exit 1
14+
fi
15+
- name: Check branch
16+
run: |
17+
branch="${{ github.event.release.target_commitish }}"
18+
if [[ "$branch" != "main" && "$branch" != hotfix/* && "$branch" != release/* ]]; then
19+
echo "Release must target main, hotfix/*, or release/* branch (got: $branch)"
20+
exit 1
21+
fi

0 commit comments

Comments
 (0)