Skip to content

fix: emit custom changelog as a job-level reusable workflow call - #145

Merged
joshua-temple merged 2 commits into
mainfrom
fix/custom-changelog-callback
Jun 13, 2026
Merged

joshua-temple merged 2 commits into
mainfrom
fix/custom-changelog-callback

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

The custom changelog path (changelog.workflow) was emitted as a step inside the finalize job:

- name: Generate Changelog (Custom)
  id: changelog
  uses: .github/workflows/cl.yaml      # reusable workflow path, no @ref, not normalized
  with:
    base_sha: ${{ needs.setup.outputs.base_sha }}
    ...

Two hazards:

  • 7a (rejected at parse): a reusable workflow cannot be invoked as a step uses:. GitHub Actions parses it as an action ref and rejects it (missing @ref); the path was also not normalized.
  • 7b (silently wrong): the step passed base_sha: ${{ needs.setup.outputs.base_sha }}, but the setup job declares changelog_base_sha, not base_sha. That value was empty at runtime.

Fix

Because a reusable workflow is invalid as a step uses:, fixing 7a forces hoisting the custom changelog into its own job (the built-in changelog path is a real step and stays a step). The new changelog job:

  • calls the reusable workflow via a normalized job-level uses: ./.github/workflows/...
  • depends on setup and passes changelog_base_sha/head_sha/repo keyed to the setup job's real outputs (fixes 7b)

The finalize job now lists changelog in its needs:, and the release step consumes needs.changelog.outputs.changelog for the custom case (steps.changelog.outputs.changelog for built-in).

Verification

  • New TestGenerator_FinalizeJob_CustomChangelog assertions: job-level uses:, normalized path, changelog_base_sha keyed to the real setup output, release reads needs.changelog.outputs.changelog; asserts the old step name and base_sha reference are gone.
  • New TestCustomChangelog_Actionlint: runs actionlint over the generated workflow and reports no issues (proves 7a/7b are gone).
  • New e2e scenario 18-custom-changelog.yaml exercises a custom changelog reusable workflow end to end.
  • go build ./... && go test ./... && golangci-lint run ./... all green; go build/go vet green in e2e/.

A custom changelog workflow was emitted as a step inside the finalize
job with uses: pointing at a reusable workflow path. GitHub Actions
rejects that at parse time: a reusable workflow cannot be invoked as a
step action, and the path lacked an @ref. The step also passed
base_sha: needs.setup.outputs.base_sha, but the setup job declares
changelog_base_sha, not base_sha, so that value was empty at runtime.

Hoist the custom changelog into its own job that calls the reusable
workflow via a normalized job-level uses:, depending on setup and
passing changelog_base_sha/head_sha/repo keyed to the setup job's real
outputs. The finalize job now lists changelog in its needs:, and the
release step reads needs.changelog.outputs.changelog. The built-in
changelog path is unchanged and stays a step.

Adds an actionlint-backed unit test proving both hazards are gone and an
e2e scenario exercising a custom changelog reusable workflow.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit de3c372 into main Jun 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant