Fix formatting of generated release notes #1738
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The "Arduino IDE" GitHub Actions workflow generates a changelog from the commits since the last tag.
This changelog is published in multiple ways:
For the last, the changelog text must be passed from the dedicated changelog generation workflow step to the release step. This is done via a workflow job output.
At the time the system was set up, outputs for workflow
run
steps were set using theset-output
workflow command. That "workflow command" system was later determined by GitHub to have potential security vulnerabilities, so it was replaced with aGITHUB_OUTPUT
environment file.The "Arduino IDE" workflow was migrated to the new "environment file" approach (#1604). It was later discovered that there was an undocumented breaking change in the method for handling multi-line strings in workflow step outputs between the old "workflow command" system and the new "environment file". This resulted in the initial release notes having an incorrect format. For example, what would previously have been formatted like this:
Was now formatted like this:
Change description
The solution is to remove the commands that did the escaping of the changelog text in a manner that is no longer supported and replace them with the "here document"-style format supported for storing multiline strings in environment files.
A random number is used as the "delimiter" (limit string) per the security recommendations in the official GitHub documentation. Note that even though the multiline strings handling documentation was placed under the environment variable section of the documentation, it also applies to setting outputs.
Other information
Demonstration release in my fork using the updated workflow:
https://github.com/per1234/arduino-ide/releases/tag/2.0.3-rc.1
Reviewer checklist