Skip to content

feat: add release-notes shared workflows for one-file consumer onboarding - #313

Merged
Mpdreamz merged 4 commits into
mainfrom
feature/release-notes-shared-workflow
Aug 31, 2026
Merged

feat: add release-notes shared workflows for one-file consumer onboarding#313
Mpdreamz merged 4 commits into
mainfrom
feature/release-notes-shared-workflow

Conversation

@Mpdreamz

Copy link
Copy Markdown
Member

Why

Onboarding a new repo to release-notes automation currently requires four separate workflow files in the consumer repo (changelog-validate, changelog-upload, changelog-bundle, and a workflow_run shim for changelog-submit). This is error-prone and any one of the four can be misconfigured silently.

This PR centralises all logic in docs-actions so a consumer repo needs one file (release-notes.yml caller) to get PR validation, push sync, and optional release bundling — and a second file for the changelog-file submit flow if the repo maintains a changelog file.

What

New reusable workflows:

  • .github/workflows/release-notes.yml — single workflow_call covering three event gates:

    • pull_request: runs changelog validate-labels; optionally runs changelog evaluate-pr --require-changelog-file when require-changelog-file: true
    • push: uploads changelog,amend artifact types to S3 via the changelog/upload action
    • release (opt-in via bundle-on-release: true): plans and creates a bundle, then uploads to S3
  • .github/workflows/release-notes-changelog-file.ymlworkflow_call wrapper (adapted from changelog-submit.yml) for repos with a changelog file. Consumer calls this from a workflow_run trigger. Same preflight/generate/apply jobs; adds id-token: write to apply.

Backward-compatible action updates:

  • changelog/upload/action.yml: add artifact-type input (default: changelog) — existing callers are unaffected
  • changelog/bundle-upload/action.yml: add bundle-path alias for output
  • changelog/bundle-create/action.yml: add output-path alias for output; skip internal plan step when pre-resolved path is supplied

The existing changelog-*.yml workflows are not modified and remain as shims.

Dependency

Requires the new CLI commands in elastic/docs-builder#3978 (changelog validate-labels, --require-changelog-file on evaluate-pr, --artifact-type amend, bundle --plan mode output). The workflows use version: edge which will pick up that branch's image once merged.

Test plan

  • Verify release-notes.yml validate job runs on a PR with/without require-changelog-file
  • Verify sync job uploads with changelog,amend on push
  • Verify release-notes-changelog-file.yml preflight/generate/apply chain works from a workflow_run caller
  • Confirm existing repos using changelog-validate.yml / changelog-upload.yml are unaffected

🤖 Generated with Claude Code

…ding

Introduce two reusable `workflow_call` workflows that centralise all
release-notes automation logic so consumer repos only need to supply
triggers and inputs:

* `.github/workflows/release-notes.yml` — single workflow covering the
  three event gates (PR validate, push sync, release bundle).  Replaces
  the four separate `changelog-validate` / `changelog-upload` /
  `changelog-bundle` calls that existing repos wire up individually.
  Inputs: `config`, `bundle-on-release` (default false), and
  `require-changelog-file` (default false) which gates `evaluate-pr`
  with `--require-changelog-file` when enabled.  The sync job always
  uploads `changelog,amend` artifact types; `--strip-title-prefix` is
  always on.  Depends on the new CLI commands shipped in
  elastic/docs-builder#3978 (shipped via the `edge` image).

* `.github/workflows/release-notes-changelog-file.yml` — companion
  `workflow_call` workflow (adapted from `changelog-submit.yml`) for
  repos that maintain a changelog file.  Consumer repos call this from a
  `workflow_run` trigger that fires when their release-notes workflow
  completes.  Keeps the same preflight/generate/apply jobs and the
  `comment-only` input; adds `id-token: write` to the apply job.

Supporting action updates (backward-compatible, no breaking changes):

* `changelog/upload/action.yml` — add `artifact-type` input (default
  `changelog`) so callers can pass `changelog,amend` explicitly rather
  than relying on the hardcoded value.
* `changelog/bundle-upload/action.yml` — add `bundle-path` as alias for
  `output` so the release-notes workflow can pass the plan step's
  `output_path` output directly.
* `changelog/bundle-create/action.yml` — add `output-path` as alias for
  `output`; when provided, skip the internal plan step and use the
  pre-resolved path.

The existing `changelog-*.yml` workflows are left intact as shims.

Co-Authored-By: Claude <noreply@anthropic.com>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner August 31, 2026 13:55
@Mpdreamz
Mpdreamz requested a review from technige August 31, 2026 13:55
actionlint flagged two direct inline uses of untrusted context values
in the Evaluate PR step:
- github.event.pull_request.title
- github.head_ref

Both are moved to environment variables (PR_TITLE, HEAD_REF) per the
GitHub security guidance on script injection attacks.

Also regenerates changelog/upload/README.md via the action-readme hook,
which was out of date after the artifact-type input was added to the
upload action.

Co-Authored-By: Claude <noreply@anthropic.com>
@Mpdreamz Mpdreamz added the enhancement New feature or request label Aug 31, 2026
Mpdreamz and others added 2 commits August 31, 2026 18:31
All inline template expansions in run: steps moved to env: vars (actionlint),
actions/checkout pinned to SHA with persist-credentials: false (zizmor),
aws-actions/configure-aws-credentials pinned to d979d5b (zizmor blanket policy).

Co-Authored-By: Claude <noreply@anthropic.com>
…ease vs bundle

bundle --plan already resolves the mode from changelog.yml (no profiles → gh-release,
profiles present → bundle). Gating the two execution paths on steps.plan.outputs.mode
eliminates the caller-supplied mode: input, the find-based gh-release output discovery
(F1/A2), the output-path alias, and the outer plan step in release-notes.yml.

github-token already defaults to github.token so callers need not pass it explicitly.

Co-Authored-By: Claude <noreply@anthropic.com>
@Mpdreamz
Mpdreamz merged commit 8696275 into main Aug 31, 2026
10 checks passed
@Mpdreamz
Mpdreamz deleted the feature/release-notes-shared-workflow branch August 31, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant