Skip to content

Commit 20d5d72

Browse files
committed
fix: handle non-version pushes in release workflow to prevent failures
1 parent c8fdae5 commit 20d5d72

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ jobs:
3232
run: |
3333
chmod +x .github/workflows/scripts/get-next-version.sh
3434
.github/workflows/scripts/get-next-version.sh "${{ github.event.inputs.release_version || '' }}"
35+
- name: Skip if nothing to release
36+
if: steps.get_tag.outputs.skip_release == 'true'
37+
run: |
38+
echo "::notice::pyproject.toml version is already tagged. No release needed for this push."
3539
- name: Validate release version matches pyproject.toml
40+
if: steps.get_tag.outputs.skip_release != 'true'
3641
run: |
3742
pyproject_version=$(grep -oE '^[[:space:]]*version[[:space:]]*=[[:space:]]*"[0-9]+\.[0-9]+\.[0-9]+"' pyproject.toml | head -n1 | sed -E 's/.*"([0-9]+\.[0-9]+\.[0-9]+)"/\1/')
3843
if [ -z "$pyproject_version" ]; then
@@ -51,25 +56,26 @@ jobs:
5156
5257
echo "Version parity check passed: $release_version"
5358
- name: Check if release already exists
59+
if: steps.get_tag.outputs.skip_release != 'true'
5460
id: check_release
5561
run: |
5662
chmod +x .github/workflows/scripts/check-release-exists.sh
5763
.github/workflows/scripts/check-release-exists.sh ${{ steps.get_tag.outputs.new_version }}
5864
env:
5965
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6066
- name: Create release package variants
61-
if: steps.check_release.outputs.exists == 'false'
67+
if: steps.get_tag.outputs.skip_release != 'true' && steps.check_release.outputs.exists == 'false'
6268
run: |
6369
chmod +x .github/workflows/scripts/create-release-packages.sh
6470
.github/workflows/scripts/create-release-packages.sh ${{ steps.get_tag.outputs.new_version }}
6571
- name: Generate release notes
66-
if: steps.check_release.outputs.exists == 'false'
72+
if: steps.get_tag.outputs.skip_release != 'true' && steps.check_release.outputs.exists == 'false'
6773
id: release_notes
6874
run: |
6975
chmod +x .github/workflows/scripts/generate-release-notes.sh
7076
.github/workflows/scripts/generate-release-notes.sh ${{ steps.get_tag.outputs.new_version }} ${{ steps.get_tag.outputs.latest_tag }}
7177
- name: Create GitHub Release
72-
if: steps.check_release.outputs.exists == 'false'
78+
if: steps.get_tag.outputs.skip_release != 'true' && steps.check_release.outputs.exists == 'false'
7379
run: |
7480
chmod +x .github/workflows/scripts/create-github-release.sh
7581
.github/workflows/scripts/create-github-release.sh ${{ steps.get_tag.outputs.new_version }}

.github/workflows/scripts/get-next-version.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ if PYPROJECT_VERSION=$(get_pyproject_version); then
7878
echo "New version will be: $PYPROJECT_VERSION (source: pyproject.toml)"
7979
exit 0
8080
fi
81+
82+
# pyproject.toml version is already tagged — nothing new to release
83+
echo "new_version=$PYPROJECT_VERSION" >> $GITHUB_OUTPUT
84+
echo "skip_release=true" >> $GITHUB_OUTPUT
85+
echo "pyproject.toml version $PYPROJECT_VERSION is already tagged. Nothing to release."
86+
exit 0
8187
fi
8288

8389
# 3) Fallback: increment latest tag

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- **Agent-agnostic canonical layout**: All command prompts now live in `.documentation/commands/` as the single source of truth. Platform directories (`.claude/`, `.github/`, `.cursor/`, etc.) contain only thin shims that redirect to canonical content with user-override resolution.
1515
- **Multi-user personalization**: New `/speckit.personalize` command creates per-user prompt overrides in `.documentation/{git-user}/commands/`. Users can customize any command without affecting team defaults; personalized files are committed to git for transparency.
1616
- **Personalize command template**: `templates/commands/personalize.md` — resolves git user identity, copies and annotates shared prompts for individual customization.
17+
- **Release template Step 10 — Update Public-Facing Version References**: `/speckit.release` now requires updating roadmap, release notes, and index docs to match the new version, plus a stale-version-string scan, preventing public documentation from drifting behind the actual release.
18+
19+
### Fixed
20+
21+
- **Release workflow fails on non-version pushes**: When `pyproject.toml` version was already tagged, `get-next-version.sh` would auto-increment to the next patch and the validation step would fail with a version mismatch. The script now detects the already-tagged condition, sets `skip_release=true`, and the workflow exits gracefully with a notice instead of failing.
1722

1823
### Changed
1924

0 commit comments

Comments
 (0)