You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 122a6c2
Browse filesBrowse the repository at this point in the historyBrowse files
Base the changelog on the previous release of the same line, and assert it (#479)
* fix: base the changelog on the previous release of the same line, and assert it
Two halves of the same problem: the release notes were computed from the wrong
base, and nothing in CI would have noticed.
base-ref was left empty, so the action asked the API for the latest release --
which is the highest release across every line. Cutting v4.9.1 therefore
diffed it against v5.0.0 and produced a symmetric difference listing commits
from both lines; two of its seven entries were real. Ask git for the previous
release tag reachable from this commit instead. That answers v4.9.0 for a v4
patch and v4.8.0 for v5.0.0, because the v4 line is not reachable from main.
--match skips the moving major tags, which sit on the same commits as the
release tags. The checkout needs fetch-depth: 0 for git describe to see any of
this. An empty result still falls back to the API, which is right for a
repository with a single line.
The end-to-end job generated four changelogs and only printed them, which is
how it stayed green while emitting a single line of literal %0A. It now
compares the frozen v0.0.1..v0.0.2 range exactly, checks that reverse: true
reverses and reverse: false matches the default, rejects percent-encoded
newlines by name, and shape-checks the release-based changelog. Outputs reach
the script through the environment rather than being pasted into it, since a
commit subject is untrusted.
Verified each assertion fails against the bug it exists for, including the
original %0A regression.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015EmepbnR2nSdk8q8DBsrsD
* fix: build the modified changelog from the environment
The assertion added alongside caught two artifacts of interpolating the
changelog into a heredoc. The value's trailing newline became an empty final
line that tac moved to the front, and the ${{ }} token sits on an indented
YAML line, so the value's first line picked up ten leading spaces -- enough for
Markdown to render it as a code block. That one survived only because the line
it landed on happens to say Bumping and is grepped away.
Read the value from the environment and drop blank lines. README carried the
same recipe.
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@@ -145,6 +144,8 @@ In order to keep this action as simple as possible we aren't planning to add mor
145
144
146
145
That heredoc is how you return a multiline value. A plain `echo "log=$log" >> $GITHUB_OUTPUT` keeps only the first line.
147
146
147
+
The changelog is read from the environment rather than interpolated into the script. `${{ }}` inside a `run:` block is textual substitution, so a value pasted into a heredoc picks up that block's YAML indentation on its first line -- which Markdown then renders as a code block -- and a commit subject is untrusted input besides.
148
+
148
149
This example used to percent-encode the newlines as `%0A` instead, which the long-gone `::set-output` command decoded. `$GITHUB_OUTPUT` does not, so that version produced a single line with literal `%0A` in it. Use a random delimiter rather than a fixed one: the value is built from commit subjects, and a fixed marker is something a commit subject could contain in order to write additional keys into `$GITHUB_OUTPUT`.
0 commit comments