44 push :
55 branches :
66 - main
7+ - " release/**"
78 paths :
89 - " packages/**"
910 - " .changeset/**"
@@ -57,11 +58,13 @@ jobs:
5758 env :
5859 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5960 run : |
60- PR_NUMBER=$(gh pr list --head changeset-release/main --json number --jq '.[0].number')
61+ SOURCE_BRANCH="${GITHUB_REF_NAME}"
62+ PR_BRANCH="changeset-release/${SOURCE_BRANCH}"
63+ PR_NUMBER=$(gh pr list --head "$PR_BRANCH" --json number --jq '.[0].number')
6164 if [ -n "$PR_NUMBER" ]; then
62- git fetch origin changeset-release/main
65+ git fetch origin "+${PR_BRANCH}:refs/remotes/origin/${PR_BRANCH}"
6366 # we arbitrarily reference the version of the cli package here; it is the same for all package releases
64- VERSION=$(git show origin/changeset-release/main :packages/cli-v3/package.json | jq -r '.version')
67+ VERSION=$(git show " origin/${PR_BRANCH} :packages/cli-v3/package.json" | jq -r '.version')
6568 gh pr edit "$PR_NUMBER" --title "chore: release v$VERSION"
6669
6770 # Enhance the PR body with a clean, deduplicated summary
@@ -78,16 +81,18 @@ jobs:
7881 # design cannot trigger downstream workflows. That leaves the required
7982 # "All PR Checks" status permanently Expected and the PR unmergeable.
8083 # The release PR only bumps package.json + lockfile + CHANGELOGs from
81- # changesets already on main , so we self-report the required check as
82- # success. If a human ever pushes to changeset- release/main , the real
83- # pr_checks.yml fires and its result overwrites this one (last write wins
84- # for the same context on the same SHA).
84+ # changesets already on the source branch , so we self-report the required
85+ # check as success. If a human pushes to the generated release branch , the
86+ # real pr_checks.yml result overwrites this one (last write wins for the
87+ # same context on the same SHA).
8588 - name : Self-report "All PR Checks" success on release PR
8689 if : steps.changesets.outputs.published != 'true'
8790 env :
8891 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8992 run : |
90- PR_NUMBER=$(gh pr list --head changeset-release/main --json number --jq '.[0].number')
93+ SOURCE_BRANCH="${GITHUB_REF_NAME}"
94+ PR_BRANCH="changeset-release/${SOURCE_BRANCH}"
95+ PR_NUMBER=$(gh pr list --head "$PR_BRANCH" --json number --jq '.[0].number')
9196 if [ -z "$PR_NUMBER" ]; then exit 0; fi
9297 HEAD_SHA=$(gh pr view "$PR_NUMBER" --json headRefOid --jq '.headRefOid')
9398 gh api -X POST repos/${{ github.repository }}/check-runs \
96101 -f status=completed \
97102 -f conclusion=success \
98103 -f 'output[title]=Auto-pass for changeset release PR' \
99- -f ' output[summary]=Required check auto-satisfied for changeset-release/main PRs. Full CI ran on the underlying commits before they landed on main.'
104+ -f " output[summary]=Required check auto-satisfied for ${PR_BRANCH} PRs. Full CI ran on the underlying commits before they landed on ${SOURCE_BRANCH}."
0 commit comments