Skip to content

Commit

Permalink
Fix the release data extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
titouanmathis committed Dec 9, 2020
1 parent 9c476c5 commit e67a24f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- run: npm run build

# @see https://github.com/actions/create-release/issues/38#issuecomment-715327220
# @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
- name: Prepare the changelog from the tag message
id: prepare_changelog
run: |
Expand All @@ -32,6 +33,8 @@ jobs:
# Parse tag message
CHANGELOG=$(git tag -l --format='%(contents)' $GITHUB_REF | tail -n+3)
echo $CHANGELOG
# Set markdown titles
CHANGELOG=${CHANGELOG/Added/## Added}
CHANGELOG=${CHANGELOG/Fixed/## Fixed}
Expand All @@ -40,15 +43,20 @@ jobs:
CHANGELOG=${CHANGELOG/Deprecated/## Deprecated}
CHANGELOG=${CHANGELOG/Security/## Security}
echo $CHANGELOG
# Remove PGP signature
CHANGELOG="${CHANGELOG%-----BEGIN*}"
echo $CHANGELOG
# Change linebreaks and other special characters
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "Setting changelog body to\n\n$CHANGELOG\n"
echo "Setting changelog body to:"
echo $CHANGELOG
echo 'changelog<<EOF' >> $GITHUB_ENV
echo $CHANGELOG >> $GITHUB_ENV
Expand All @@ -62,8 +70,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ env.GITHUB_ENV.release_version }}
body: ${{ env.GITHUB_ENV.changelog }}
release_name: v${{ env.release_version }}
body: ${{ env.changelog }}
draft: false
prerelease: false

Expand Down

0 comments on commit e67a24f

Please sign in to comment.