From 7eebdd1f4068c5f93ea44db064e80bde712e6936 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Tue, 21 Jul 2026 22:52:28 +0100 Subject: [PATCH] ci(regen): merge the weekly regeneration PR automatically The weekly job already gates the update. `make regen` fails on any audit fallback and the test step runs the full race suite, so a PR only opens when both pass. Merge it from the same job. A PR opened with GITHUB_TOKEN does not trigger ci.yml, so GitHub auto-merge would wait for checks that never start. The push to main triggers ci.yml, which cuts the release. --- .github/workflows/regen.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/regen.yml b/.github/workflows/regen.yml index 1d5706b..edbd312 100644 --- a/.github/workflows/regen.yml +++ b/.github/workflows/regen.yml @@ -88,6 +88,7 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Open PR + id: pr if: steps.diff.outputs.no_changes != 'true' uses: peter-evans/create-pull-request@v8 with: @@ -115,4 +116,17 @@ jobs: Inspect the IR diff (`internal/spec/api.json`) for added/changed/removed methods. - CI must pass before merge. Auto-merge: enable when satisfied with the diff. + This PR merges itself once every step above passes. The gates are + `make regen` (which fails on any audit fallback) and `go test -race ./...`, + both run in this job before the PR opens. + + # A PR opened with GITHUB_TOKEN does not trigger `ci.yml`, so waiting for + # PR checks would wait forever. The gates already ran in this job: `make + # regen` fails on any audit fallback, and the test step runs the full race + # suite. Merging here therefore means "merged because the checks passed". + # `ci.yml` then runs on the push to main and cuts the release. + - name: Merge regen PR + if: steps.diff.outputs.no_changes != 'true' && steps.pr.outputs.pull-request-number != '' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr merge "${{ steps.pr.outputs.pull-request-number }}" --squash --delete-branch