From b051cf109243521a861c0c0d6d3b7b7b9602dd6d Mon Sep 17 00:00:00 2001 From: systemfsoftware-bot Date: Fri, 20 Nov 2026 21:10:21 -0500 Subject: [PATCH 1/2] ci(release): approve the CI run a force-release pull request holds --- .github/workflows/force-release.yml | 56 ++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/.github/workflows/force-release.yml b/.github/workflows/force-release.yml index f683e29f..92a0fc4a 100644 --- a/.github/workflows/force-release.yml +++ b/.github/workflows/force-release.yml @@ -18,13 +18,18 @@ on: - major permissions: - contents: write - pull-requests: write + contents: read jobs: force-release: name: dummy changeset + release PR runs-on: ubuntu-latest + outputs: + pr_number: ${{ steps.pr.outputs.number }} + head_sha: ${{ steps.pr.outputs.head_sha }} + permissions: + contents: write + pull-requests: write env: HUSKY: "0" steps: @@ -44,6 +49,7 @@ jobs: chore(release): force $BUMP release for $PACKAGE via workflow dispatch EOF - name: Commit, push, and open PR + id: pr env: GH_TOKEN: ${{ github.token }} BRANCH: force-release/${{ inputs.bump }}-${{ github.run_id }} @@ -56,8 +62,50 @@ jobs: git add .changeset git commit -m "chore(release): force $BUMP via workflow dispatch" git push origin "$BRANCH" - gh pr create \ + url=$(gh pr create \ --base "$BASE" \ --head "$BRANCH" \ --title "chore(release): force $BUMP" \ - --body "Manually triggered ${BUMP} release (run ${{ github.run_id }}). Merging drops a dummy changeset intent on main; the Release workflow then opens the version-packages PR." + --body "Manually triggered ${BUMP} release (run ${{ github.run_id }}). Merging drops a dummy changeset intent on main; the Release workflow then opens the version-packages PR.") + # The pull request's own head commit, as GitHub reports it. + gh pr view "$url" --json number,headRefOid --jq '"number=\(.number)\nhead_sha=\(.headRefOid)"' >> "$GITHUB_OUTPUT" + + approve-ci: + name: approve the held CI run + needs: force-release + if: needs.force-release.outputs.pr_number != '' + runs-on: ubuntu-latest + permissions: + actions: write + env: + GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ needs.force-release.outputs.pr_number }} + HEAD_SHA: ${{ needs.force-release.outputs.head_sha }} + steps: + # A pull request opened with the workflow token starts its pull_request workflows in `action_required` with no + # jobs, so the required check is never emitted until a person or token with actions access approves the run. + # Fails closed: it succeeds only when every held run was approved or a run for the pull request already exists. + - name: Approve every pull_request run the pull request holds + run: | + for _ in $(seq 1 12); do + runs=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs?head_sha=$HEAD_SHA&event=pull_request&per_page=100" \ + --jq "[.workflow_runs[] + | select(.head_repository.full_name == \"$GITHUB_REPOSITORY\" + and .actor.login == \"github-actions[bot]\" + and any(.pull_requests[]?; .number == ($PR_NUMBER | tonumber)))]") + held=$(jq -r '[.[] | select(.conclusion == "action_required") | .id] | .[]' <<< "$runs") + if [ -n "$held" ]; then + for id in $held; do + gh api --method POST "repos/$GITHUB_REPOSITORY/actions/runs/$id/approve" + echo "Approved run $id." + done + exit 0 + fi + if [ "$(jq 'length' <<< "$runs")" -gt 0 ]; then + echo "A pull_request run already exists for #$PR_NUMBER and none is held." + exit 0 + fi + sleep 5 + done + echo "::error::No pull_request run was found for #$PR_NUMBER at $HEAD_SHA." + exit 1 From f9fe515f729af285b897f291ca61700b485eb323 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 02:10:45 +0000 Subject: [PATCH 2/2] chore(release): force patch via workflow dispatch --- .changeset/force-44854410344-patch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/force-44854410344-patch.md diff --git a/.changeset/force-44854410344-patch.md b/.changeset/force-44854410344-patch.md new file mode 100644 index 00000000..d1681b45 --- /dev/null +++ b/.changeset/force-44854410344-patch.md @@ -0,0 +1,5 @@ +--- +"@systemfsoftware/xstate": patch +--- + +chore(release): force patch release for @systemfsoftware/xstate via workflow dispatch