Skip to content

Commit

Permalink
Fix formatting for COMMIT_MESSAGES in GitHub Actions
Browse files Browse the repository at this point in the history
This update addresses an issue where new line and carriage return characters in COMMIT_MESSAGES were not properly formatted. Now, these characters are correctly encoded for usage in the GitHub Environment variable.
  • Loading branch information
MarjovanLier committed Feb 8, 2024
1 parent efa3d0f commit 4d635d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ jobs:
if: github.ref == 'refs/heads/main' && steps.rector.outcome == 'success'
run: |
COMMIT_MESSAGES=$(git log $LATEST_TAG..HEAD --pretty=format:"%h - %s")
echo "COMMIT_MESSAGES=$COMMIT_MESSAGES" >> $GITHUB_ENV
COMMIT_MESSAGES="${COMMIT_MESSAGES//'%'/'%25'}"
COMMIT_MESSAGES="${COMMIT_MESSAGES//$'\n'/'%0A'}"
COMMIT_MESSAGES="${COMMIT_MESSAGES//$'\r'/'%0D'}"
echo "COMMIT_MESSAGES=${COMMIT_MESSAGES}" >> $GITHUB_ENV
# This step creates a new release with the new tag and the commit messages as the body.
- name: Create release
Expand Down

0 comments on commit 4d635d0

Please sign in to comment.