Support multi-line

{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
This commit is contained in:
crazywhalecc 2025-06-14 02:27:48 +08:00
parent 45ec0cef24
commit 3a0d21eb44
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -32,12 +32,14 @@ jobs:
echo "skip_craft=yes" >> $GITHUB_OUTPUT
exit 0
else
echo "\e[32mCraft tags found in commit message.\e[0m"
echo -e "\e[32mCraft tags found in commit message.\e[0m"
# get the craft content
CRAFT_CONTENT=$(echo "$COMMIT_MESSAGE" | sed -nz 's/.*{craft}\(.*\){\/craft}.*/\1/p')
echo "Craft content: $CRAFT_CONTENT"
# set the output variable
echo "craft=$CRAFT_CONTENT" >> $GITHUB_OUTPUT
echo "craft<<EOF" >> $GITHUB_OUTPUT
echo "$CRAFT_CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
# parse the bash test script from the commit message
@ -45,12 +47,14 @@ jobs:
echo "No {bash} tags found in commit message. Skipping bash test."
echo "skip_bash=yes" >> $GITHUB_OUTPUT
else
echo "\e[32mBash tags found in commit message.\e[0m"
echo -e "\e[32mBash tags found in commit message.\e[0m"
# get the bash content
BASH_CONTENT=$(echo "$COMMIT_MESSAGE" | sed -nz 's/.*{bash}\(.*\){\/bash}.*/\1/p')
echo "Bash content: $BASH_CONTENT"
# set the output variable
echo "bash=$BASH_CONTENT" >> $GITHUB_OUTPUT
echo "bash<<EOF" >> $GITHUB_OUTPUT
echo "$BASH_CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
# parse spc_prefix from commit message, e.g. [spc_prefix:bin/spc-gnu-docker], default: bin/spc