Skip to content

fix(ci): release from the dispatched branch instead of a branch input - #1675

Merged
lucasmcdonald3 merged 6 commits into
masterfrom
release-from-dispatch-branch
Jul 22, 2026
Merged

fix(ci): release from the dispatched branch instead of a branch input#1675
lucasmcdonald3 merged 6 commits into
masterfrom
release-from-dispatch-branch

Conversation

@lucasmcdonald3

@lucasmcdonald3 lucasmcdonald3 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

Remove the branch input from workflows.

Before, the src/test code from branch would be checked out, but NOT the test environments configured on branch. This led to a weird case where I was trying to release from branch=v4.x from the master branch. ESDK JS 4.x supports node <22 but 5.x doesn't; master doesn't test against <22 since it's a 5.x branch.

Now, release always runs from the branch configured in the release workflow run. (This is also simpler, Kess and I were confused by this distinction earlier)

(Should also note that the "must release from a branch" (versus releasing from a specific commit) requirement was implicit, but is now explicit. In the release workflow the CI bot pushes a changelog commit, which would fail if it checked out a commit rather than a branch.)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

A reusable workflow's job definition (including the node-version test
matrix) is always read from the same git ref as the caller, not from the
checked-out code. So passing a 'branch' input could only change which code
was tested, never which matrix ran -- releasing v4.x from master would
still test against master's node versions and miss v4.x-only versions
(18.x/20.x).

Drive the release off github.ref_name so the branch being released is the
ref the workflow runs on: its own shared-ci matrix and jobs apply. Remove
the misleading 'branch' input from both prod-release and shared-ci. shared-ci
now checks out the triggering ref by default (PR merge ref for CI, dispatched
branch for release). Publish checks out by branch name so it includes the
version-bump commit pushed by the version job.

To release a branch, dispatch the Release workflow from that branch.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the release and shared CI reusable workflows so they operate on the ref that triggered the run (e.g., the workflow-dispatched release branch), keeping the checked-out code aligned with the reusable workflow definition and its test matrix.

Changes:

  • Remove the branch workflow input and stop explicitly checking out inputs.branch in the shared reusable CI workflow.
  • In the production release workflow, switch from a branch input to using github.ref_name for selecting the branch to release from.
  • Add clarifying comments explaining why the workflow should run/release from the dispatched ref.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/shared-ci.yml Removes branch input usage and relies on the triggering ref for checkout to keep tests aligned to the workflow’s branch.
.github/workflows/prod-release.yml Releases from the dispatched ref (github.ref_name) and ensures publish checks out the branch name to pick up the version-bump commit.
Comments suppressed due to low confidence (1)

.github/workflows/shared-ci.yml:9

  • Removing the branch input from this reusable workflow will break existing callers that still pass with: branch: ... (GitHub rejects unexpected inputs for workflow_call). For example, .github/workflows/ci.yml currently calls this workflow with with: branch: ${{ inputs.branch || 'master' }}.

Either update all call sites in the same PR, or keep a deprecated branch input here (even if it is ignored) to maintain compatibility.

    inputs:
      test-published-packages:
        description: 'Test against published packages instead of checked out code'
        required: false
        type: boolean

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 75 to 79
env:
BRANCH: ${{ github.event.inputs.branch }}
BRANCH: ${{ github.ref_name }}
run: |
git config --global user.name "aws-crypto-tools-ci-bot"
git config --global user.email "no-reply@noemail.local"
Lucas McDonald and others added 5 commits July 21, 2026 14:06
ci.yml forwards `branch` to shared-ci.yml, but that input was just removed,
so the reusable-workflow call failed at startup on every pull_request run.

Re-add `branch` as optional (default empty = the triggering ref) and forward
it from ci.yml without the `|| 'master'` fallback. PR CI now checks out the
PR ref instead of master, release still uses the dispatched ref, and daily CI
can still target the v4.x maintenance branch.
The workflow ref is the only branch selector. Remove the branch input from
ci.yml and shared-ci.yml so checkout always uses the triggering ref, keeping
tested code and the reusable-workflow matrix on the same branch. Guard the
release against non-branch dispatch (lerna version pushes to the branch head).
@lucasmcdonald3
lucasmcdonald3 merged commit 235d871 into master Jul 22, 2026
24 checks passed
@lucasmcdonald3
lucasmcdonald3 deleted the release-from-dispatch-branch branch July 22, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants