Skip to content

Commit

Permalink
Fix release MR template
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyrZotov committed Mar 24, 2023
1 parent 27fbc71 commit e6af1d5
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,20 @@ 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
This is an automated PR for a new release.
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.
echo "pr_body<<${DELIMITER}" >> "${GITHUB_OUTPUT}"
echo "This is an automated PR for a new release.
Please check the following before approving:
- [ ] Changelog is accurate. The documented changes for this release are printed below.
- [ ] Any files referencing a version number. Confirm it matches the version number in the branch name.
---
## 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
${LOG_ENTRY}" >> "${GITHUB_OUTPUT}"
echo "${DELIMITER}" >> "${GITHUB_OUTPUT}"
- name: Create Pull Request via API
id: post_pr
uses: octokit/request-action@v2.x
Expand Down

0 comments on commit e6af1d5

Please sign in to comment.