Skip to content

Commit 1c458a7

Browse files
avoid parsing ANSI escape codes
1 parent 323e0dc commit 1c458a7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/workflows/createRelease.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
mkdir -p "releases/$RELEASE_NAME"
7979
8080
echo "::group::Generating release definition"
81+
export SFPOWERSCRIPTS_NOCOLOR=true
8182
releaseDefinitionOutput=$(sfp releasedefinition generate \
8283
--gitref "$GIT_REF" \
8384
--configfile "$PATH_TO_CONFIG_FILE" \
@@ -87,11 +88,9 @@ jobs:
8788
--nopush)
8889
echo "$releaseDefinitionOutput"
8990
90-
# Extract YAML content (lines starting with a space) and remove ANSI color codes
91-
echo "$releaseDefinitionOutput" |
92-
sed 's/\x1b[[0-9;]*m//g' |
93-
awk '/^release:/,/^$/' |
94-
sed '/^$/d' > "releases/$RELEASE_NAME/$RELEASE_NAME.yml"
91+
# Extract YAML content (second paragraph)
92+
awk -v RS='\n\n' 'NR==2' <<< "$releaseDefinitionOutput" \
93+
> "releases/$RELEASE_NAME/$RELEASE_NAME.yml"
9594
9695
# Verify the file was created and has content
9796
if [ -s "releases/$RELEASE_NAME/$RELEASE_NAME.yml" ]; then

0 commit comments

Comments
 (0)