From 9868104f1c2846f22184d824133678135372d487 Mon Sep 17 00:00:00 2001 From: cswimr Date: Mon, 21 Oct 2024 13:55:42 -0400 Subject: [PATCH] use `printf` to avoid commit messages containing `` from running commands on the actions runner --- .gitea/workflows/actions.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index 80fce3f..cd870f3 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -129,7 +129,8 @@ jobs: id: check_commit_message run: | COMMIT_MESSAGE="${{ steps.extract_commit_message.outputs.message }}" - OUTPUT="$(python .gitea/workflows/scripts/message.py "$COMMIT_MESSAGE")" + ESCAPED_COMMIT_MESSAGE="$(printf '%q' "$COMMIT_MESSAGE")" + OUTPUT="$(python .forgejo/workflows/scripts/message.py '$ESCAPED_COMMIT_MESSAGE')" if [ "$OUTPUT" = "Usage: python message.py " ]; then echo "Called without commit message!" exit 1