Skip to content

Commit ef04846

Browse files
jonhopper-dataengineersCortex Code
andcommitted
Fix release workflow: strip CRLF from extracted version
The dbt_project.yml has CRLF line endings causing a trailing \r in the extracted version string. Added tr -d to strip carriage returns and removed debug logging. .... 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 e7cebab commit ef04846

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Extract version from dbt_project.yml
2222
id: version
2323
run: |
24-
VERSION=$(grep "^version:" dbt_project.yml | sed "s/version: *//;s/['\"]//g")
24+
VERSION=$(grep "^version:" dbt_project.yml | sed "s/version: *//;s/['\"]//g" | tr -d '\r\n ')
2525
if [ -z "$VERSION" ]; then
2626
echo "::error::Could not extract version from dbt_project.yml"
2727
exit 1
@@ -45,24 +45,19 @@ jobs:
4545
id: changelog
4646
run: |
4747
VERSION="${{ steps.version.outputs.version }}"
48-
echo "DEBUG: VERSION='$VERSION'"
49-
echo "DEBUG: Looking for header_prefix='## v$VERSION'"
50-
head -5 CHANGELOG.md
5148
# Use Python for exact string matching (no regex dot issues)
5249
# Outputs: release title (from header) and release notes (body)
5350
# Changelog headers use 'v' prefix (e.g. ## v1.0.4)
5451
python3 -c "
5552
import sys
5653
version = 'v' + sys.argv[1]
5754
header_prefix = '## ' + version
58-
print(f'DEBUG: searching for header_prefix={repr(header_prefix)}', file=sys.stderr)
5955
found = False
6056
title = ''
6157
lines = []
6258
for line in open('CHANGELOG.md'):
6359
stripped = line.rstrip()
6460
if stripped.startswith('## '):
65-
print(f'DEBUG: found header={repr(stripped)}', file=sys.stderr)
6661
if found:
6762
break
6863
if stripped == header_prefix or stripped.startswith(header_prefix + ' ') or stripped.startswith(header_prefix + '\t'):

0 commit comments

Comments
 (0)