Skip to content

Commit

Permalink
Use the multi-line $GITHUB_OUTPUT syntax for the changelog entry ou…
Browse files Browse the repository at this point in the history
…tput (#692)

The changelog entry is multi-line, so we need to use the multi-line syntax
when using the `$GITHUB_OUTPUT` file.

This resolves:

```
Error: Unable to process file command 'output' successfully.
Error: Invalid format '### Added'
```

See:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings

GUS-W-14177169.
  • Loading branch information
edmorley authored Sep 25, 2023
1 parent 95204ad commit 56b4f4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ jobs:
- name: Extract changelog entry
id: changelog-entry
run: echo "content=$(awk '/^## \[${{ steps.new-version.outputs.version }}\]/{flag=1; next} /^## /{flag=0} flag' CHANGELOG.md)" >> "${GITHUB_OUTPUT}"
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
run: |
{
echo 'content<<CHANGELOG_END'
awk '/^## \[${{ steps.new-version.outputs.version }}\]/{flag=1; next} /^## /{flag=0} flag' CHANGELOG.md
echo CHANGELOG_END
} >> "${GITHUB_OUTPUT}"
- name: Publish to crates.io
# cargo-release calculates the dependency graph for us, and also skips any already
Expand Down

0 comments on commit 56b4f4e

Please sign in to comment.