Skip to content

Commit

Permalink
Fix classic buildpack prepare release workflow (#192)
Browse files Browse the repository at this point in the history
Currently if the `git log` generated to populate the PR description
contains more than one commit, the workflow fails with errors like:

```
Error: Unable to process file command 'output' successfully.
Error: Invalid format '- Migrate from CircleCI to GHA (#214)'
```

This is because of the GitHub Actions gotcha around multi-line
strings when using `GITHUB_OUTPUT` (or `GITHUB_ENV`):
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings

This didn't come up during testing, since the repo I tried with
didn't have multiple commits on `main` since the last tag.

See also:
heroku/heroku-buildpack-nodejs#1153
heroku/libcnb.rs#692

GUS-W-14894410.
  • Loading branch information
edmorley authored Feb 1, 2024
1 parent 77fd56b commit 50fda55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/_classic-buildpack-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ jobs:

- name: Generate list of unreleased commits
id: unreleased-commits
run: echo "commits=$(git log --topo-order --reverse --format='- %s' v${{ steps.existing-version.outputs.version }}...main)" >> "${GITHUB_OUTPUT}"
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
run: |
{
echo 'commits<<COMMITS_LIST_END'
git log --topo-order --reverse --format='- %s' v${{ steps.existing-version.outputs.version }}...main
echo COMMITS_LIST_END
} >> "${GITHUB_OUTPUT}"
- name: Create pull request
id: pr
Expand Down

0 comments on commit 50fda55

Please sign in to comment.