perf: consolidate git-cliff invocations behind a single install - #13
Merged
Conversation
Replaces two `orhun/git-cliff-action` invocations (one for --bumped-version,
one for --latest --strip all) with:
1. One install step via giantswarm/install-binary-action
2. One shell step that runs git-cliff twice: --bump --context to emit the
JSON context (one set of GitHub API calls for PR lookups), then
--from-context to render the body from that cached JSON (no API
calls, no commit walk — ~40ms locally).
Savings per workflow run: avoids re-installing git-cliff (~1s × 2) and
re-doing the API PR-lookup pass (~3s × 2). Net ~5–8s shaved off a
~15-second run.
Side benefits:
- `steps.cliff.outputs.version` is now read straight from the JSON via
`jq -r '.[0].version'`, which is what the older git-cliff-action's
`version` output was trying (and silently failing) to do for
--bumped-version. Removes the trim-content workaround we had to do in
the decide step.
- Renders the body upfront (cheap) rather than only after the tag push.
Result is identical because --bump uses the bumped version; the cached
context already reflects what `--latest` would have seen post-push.
Local validation:
$ git-cliff --bump --context > ctx.json
$ jq -r '.[0].version' ctx.json
v1.5.0
$ time git-cliff --from-context ctx.json --strip all
... (rendered body) ...
git-cliff --from-context 0.01s user 0.02s system 96% cpu 0.038 total
3 tasks
2 tasks
fiunchinho
added a commit
that referenced
this pull request
Jun 3, 2026
Regression introduced in #13 (the consolidate-git-cliff-calls change). The old workflow used `--latest --strip all` on the render step, where `--latest` filtered the output to just the bumped release. When I consolidated to `--bump --context` + `--from-context`, I kept `--strip all` (whitespace handling) but dropped `--latest`, with the result that the context JSON contained EVERY release since repo inception and the render concatenated all of them into each new release's notes body. Symptom: v1.4.1 and v1.4.2 release pages have notes that include v1.4.0, v1.3.2, v1.3.1, … all the way back to v1.0.0. v1.4.0 (created before #13 landed) is clean. Fix is a one-word addition: pass `--latest` alongside `--bump --context` so the JSON only contains the bumped release. Render then has nothing else to render. No need for --latest on the --from-context call (which turns out to be ignored anyway — filtering has to happen at context generation time). Local verification: `git-cliff --latest --bump --context | jq 'length'` returns 1 (one release in the JSON); rendering that JSON produces a body with just the latest release's bullets + footer. Cleanup of the already-broken v1.4.1 and v1.4.2 release bodies is a separate, optional follow-up (gh release edit --notes-file).
5 tasks
fiunchinho
added a commit
that referenced
this pull request
Jun 3, 2026
…y bumps (#16) PR #15's "fix" for the full-history regression was wrong. I added `--latest` thinking it would filter the cliff context to just the bumped release; what it actually does in combination with `--bump` is return the latest EXISTING tag and silently drop the bump. Result: PR #15's merge ran the workflow successfully but computed `next: v1.4.2` (the existing tag), said "no releasable commits", and skipped tagging. We never got the v1.4.3 release that should have validated #15 itself. The right flag is `--unreleased --bump --context`: --unreleased : filter to commits not yet in any tag --bump : compute the bumped version from those commits --context : output as JSON Together they produce a single-release JSON for just the bumped version. Verified locally on a fresh clone at the PR #15 merge commit: returns `v1.4.3` (correct), one element in the JSON, renders cleanly with just the new release's bullets + Full Changelog footer. Acknowledging: this is the second swing at the same regression (originally introduced in #13, mis-fixed in #15). Lesson: end-to-end local testing on a fresh clone with the real tag history would have caught both issues immediately.
fiunchinho
added a commit
that referenced
this pull request
Jun 3, 2026
The header described a two-cliff-invocation design referencing `auto-tag.yaml` (renamed to `auto-release.yaml`) and `--bumped-version` (replaced by `--bump --context` + jq parsing). PR #13 consolidated the two invocations into a single `--unreleased --bump --context` call that emits JSON the workflow then re-renders with `--from-context`. The comment never caught up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces two
orhun/git-cliff-actioninvocations with one install + one shell step. Saves ~5–8s per workflow run and removes a workaround for the action's flakyversionoutput.What changes
Why this is correct
git-cliff --bump --contextdoes all the expensive work — walks commits, queries the GitHub API per commit for PR lookups, emits a JSON context with everything baked in.--from-contextthen renders the configured template against that JSON with no further API calls and no git traversal. Local timing: 38ms.Output is identical to the previous two-action flow because:
--bumpuses the same bumped-version semantics as the old--bumped-version--latestwould have seen after the tag push (both render the bumped release's commits)Side benefits
outputs.contenttrim hack. The previous flow readsteps.cliff.outputs.content(the action's stdout capture) and trimmed whitespace, because the action'soutputs.versionwas unreliable for--bumped-version(it parsed the wrong JSON field). Now we read the version straight from our owncliff-context.jsonvia jq — no quirky action behavior to work around.Test plan
git-cliff --bump --context | jq '.[0].version'returns the correct bumped version;git-cliff --from-context ... --strip allrenders the same body the old flow produced.v1.5.0(or whatever the bump produces, this is aperf:so no bump on its own — but the squash commit would beperf: ... (#13)which IS conventional and would bump per cliff.toml... wait,perfmaps toChangedgroup but doesn't trigger a bump in git-cliff's default. So this PR might produce NO release. Worth noting.)Heads-up about the bump: this is
perf:which git-cliff's default bumper treats like docs/chore — no bump triggered. The merge of this PR may not produce a release. If you want to validate end-to-end, the next conventionalfix:orfeat:after this lands will validate everything.