Skip to content

Commit 6df64af

Browse files
authored
DEV: Add body to created GitHub release (#1985)
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
1 parent 85ca63e commit 6df64af

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ jobs:
4646
latest_tag=$(git describe --tags --abbrev=0)
4747
echo "latest_tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_ENV"
4848
echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
49-
tag_body=$(git tag -l "${latest_tag}" --format='%(contents:body)')
49+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
50+
echo "tag_body<<$EOF" >> "$GITHUB_ENV"
51+
git tag -l "${latest_tag}" --format='%(contents:body)' >> "$GITHUB_ENV"
52+
echo "$EOF" >> "$GITHUB_ENV"
5053
- name: Create GitHub Release 🚀
5154
uses: actions/create-release@v1
5255
env:
@@ -56,4 +59,4 @@ jobs:
5659
release_name: Version ${{ env.latest_tag }}, ${{ env.date }}
5760
draft: false
5861
prerelease: false
59-
body: Body is ${{ env.tag_body }}
62+
body: ${{ env.tag_body }}

0 commit comments

Comments
 (0)