From 50fda551100512c0e22ed2f3af8ef29737289a89 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:58:50 +0000 Subject: [PATCH] Fix classic buildpack prepare release workflow (#192) 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: https://github.com/heroku/heroku-buildpack-nodejs/pull/1153 https://github.com/heroku/libcnb.rs/pull/692 GUS-W-14894410. --- .github/workflows/_classic-buildpack-prepare-release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_classic-buildpack-prepare-release.yml b/.github/workflows/_classic-buildpack-prepare-release.yml index d9be2d3c..1f8961ce 100644 --- a/.github/workflows/_classic-buildpack-prepare-release.yml +++ b/.github/workflows/_classic-buildpack-prepare-release.yml @@ -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<> "${GITHUB_OUTPUT}" - name: Create pull request id: pr