Skip to content

Commit c7e2d47

Browse files
jonhopper-dataengineersCortex Code
andcommitted
Fix release workflow: add 'v' prefix to tag and changelog lookup
The changelog uses 'v' prefixed headers (e.g. ## v1.0.4) but the version from dbt_project.yml is just '1.0.4'. Added 'v' prefix to tag checks, changelog matching, and release creation. .... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code) Co-Authored-By: Cortex Code <noreply@snowflake.com>
1 parent 09c6e70 commit c7e2d47

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232
- name: Check if tag already exists
3333
id: check_tag
3434
run: |
35-
if git rev-parse --verify "refs/tags/${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
35+
if git rev-parse --verify "refs/tags/v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
3636
echo "exists=true" >> "$GITHUB_OUTPUT"
37-
echo "Tag ${{ steps.version.outputs.version }} already exists — skipping release."
37+
echo "Tag v${{ steps.version.outputs.version }} already exists — skipping release."
3838
else
3939
echo "exists=false" >> "$GITHUB_OUTPUT"
40-
echo "Tag ${{ steps.version.outputs.version }} does not exist — will create release."
40+
echo "Tag v${{ steps.version.outputs.version }} does not exist — will create release."
4141
fi
4242
4343
- name: Extract changelog for this version
@@ -47,9 +47,10 @@ jobs:
4747
VERSION="${{ steps.version.outputs.version }}"
4848
# Use Python for exact string matching (no regex dot issues)
4949
# Outputs: release title (from header) and release notes (body)
50+
# Changelog headers use 'v' prefix (e.g. ## v1.0.4)
5051
python3 -c "
5152
import sys
52-
version = sys.argv[1]
53+
version = 'v' + sys.argv[1]
5354
header_prefix = '## ' + version
5455
found = False
5556
title = ''
@@ -84,7 +85,7 @@ jobs:
8485
env:
8586
GH_TOKEN: ${{ github.token }}
8687
run: |
87-
gh release create "${{ steps.version.outputs.version }}" \
88+
gh release create "v${{ steps.version.outputs.version }}" \
8889
--title "${{ steps.changelog.outputs.title }}" \
8990
--notes-file /tmp/release_notes.md \
9091
--target "${{ github.sha }}"

0 commit comments

Comments
 (0)