Properly use new github step output syntax

This commit is contained in:
Eddy Filip
2023-06-14 17:22:52 +02:00
parent d00fc40e90
commit c7548af5c3

View File

@@ -53,9 +53,10 @@ jobs:
id: prep_pr
run: |
CHANGELOG_PATH=$(printf "%s/CHANGELOG.md" "${GITHUB_WORKSPACE}")
LOG_ENTRY=$(awk '/START\/v[0-9]+\.[0-9]+\.[0-9]+*/{f=1; next} /---/{if (f == 1) exit} f' "${CHANGELOG_PATH}")
export PR_BODY=$(cat <<EOF
DELIMITER="$(openssl rand -hex 8)" # DELIMITER is randomly generated and unique for each run. For more information, see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#understanding-the-risk-of-script-injections.
PR_BODY_CONTENT="
This is an automated PR for a new release.
Please check the following before approving:
@@ -64,14 +65,9 @@ jobs:
---
## Release Changelog Preview
${LOG_ENTRY}
EOF
)
"
# Sanitizes multiline strings for action outputs (https://medium.com/agorapulse-stories/23f56447d209)
PR_BODY="${PR_BODY//'%'/'%25'}"
PR_BODY="${PR_BODY//$'\n'/'%0A'}"
PR_BODY="${PR_BODY//$'\r'/'%0D'}"
echo "pr_body=$(echo "$PR_BODY")" >> $GITHUB_OUTPUT
echo "pr_body<<${DELIMITER}${PR_BODY_CONTENT}${DELIMITER}" >> "${GITHUB_OUTPUT}"
- name: Create Pull Request via API
id: post_pr