Skip to content

Commit

Permalink
DEV: Add body to created GitHub release (#1985)
Browse files Browse the repository at this point in the history
PR fixes that new GitHub releases were lacking a body, where this was due to the fact that we were not outputting `tag_body` to `$GITHUB_ENV` so that it wasn't available in follow-up steps. However, because the body is a multiline string, we've got to wrap it in special syntax to get it to work (see [docs](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string) for example).

See https://github.com/py-pdf/pypdf/actions/runs/5601580443/jobs/10245662760?pr=1985 as an example test run that shows it working in a test workflow.

Closes #1971
  • Loading branch information
MasterOdin authored Jul 20, 2023
1 parent 85ca63e commit 6df64af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ jobs:
latest_tag=$(git describe --tags --abbrev=0)
echo "latest_tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
tag_body=$(git tag -l "${latest_tag}" --format='%(contents:body)')
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "tag_body<<$EOF" >> "$GITHUB_ENV"
git tag -l "${latest_tag}" --format='%(contents:body)' >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
- name: Create GitHub Release 🚀
uses: actions/create-release@v1
env:
Expand All @@ -56,4 +59,4 @@ jobs:
release_name: Version ${{ env.latest_tag }}, ${{ env.date }}
draft: false
prerelease: false
body: Body is ${{ env.tag_body }}
body: ${{ env.tag_body }}

0 comments on commit 6df64af

Please sign in to comment.