From 8e9000bc08e54f4cabf3b71cdc0bcbb9b7ac934f Mon Sep 17 00:00:00 2001 From: Matthew Cane Date: Wed, 24 Jul 2024 13:12:05 +0100 Subject: [PATCH] Fix invalid "quotes" and other chars in commit message breaking formatting --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 8182781..9d11e3a 100644 --- a/action.yaml +++ b/action.yaml @@ -31,7 +31,7 @@ runs: id: commit env: GH_TOKEN: ${{ inputs.github_token }} - run: echo message=$(gh api /repos/${{ github.repository }}/commits/${{ github.sha }} --jq '.commit.message' | head -1) >> "$GITHUB_OUTPUT" + run: echo message=$(gh api /repos/${{ github.repository }}/commits/${{ github.sha }} --jq '.commit.message' | head -1 | jq -Rrsc . ) >> "$GITHUB_OUTPUT" # The head -1 is there to ensure multi-line commit messages don't break # the formatting of the JSON payload as CR/LF control chars are unable # to be escaped cleanly.