Skip to content

Commit

Permalink
Implement Nikolaus feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
m4rc1e committed Nov 10, 2020
1 parent c0890d1 commit 3164649
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ jobs:
# https://github.com/actions/checkout/issues/290
git fetch --tags --force
TAG_NAME=${GITHUB_REF/refs\/tags\//}
CHANGELOG=$(git tag -l --format='%(contents)' $TAG_NAME)
# we have to escape all new line characters and carriage
# returns before passing them into set-output otherwise the
# body content of the release will only contain the first line
# https://github.com/actions/create-release/issues/38#issuecomment-640072234
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=changelog::$CHANGELOG"
echo "$(git tag -l --format='%(contents)' $TAG_NAME)" > CHANGELOG.md
- name: Create GitHub release
id: create_release
Expand All @@ -51,10 +43,7 @@ jobs:
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
# To set the body arg, we fetch the changelog variable we created
# in the previous step. Implementation is based on
# the third example in https://github.com/actions/create-release/pull/11
body: ${{ steps.release_notes.outputs.changelog }}
body_path: CHANGELOG.md
draft: false
prerelease: false

Expand Down

2 comments on commit 3164649

@anthrotype
Copy link
Member

@anthrotype anthrotype commented on 3164649 Nov 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: wouldn't it be better to save it to a temporary file instead of a file named CHANGELOG.md in the root of the repo? Maybe it's not the case in here but there may well be a file named like that.

@m4rc1e
Copy link
Collaborator Author

@m4rc1e m4rc1e commented on 3164649 Nov 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGELOG.md in the root of the repo? Maybe it's not the case in here but there may well be a file named like that.

SGTM. I've now saved the CHANGELOG.md to the runner's temp dir instead.

Please sign in to comment.