From 497a9dc80760705b6d21a246bcea704a973318c4 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 9 Oct 2026 22:28:49 -0700 Subject: [PATCH] ci: remove the automatic release back-merge (backport) release's copy of the Back-merge workflow runs on every push to release, so it must go here too. Drop the workflow, its script and recipe, and the Alert entry. Co-Authored-By: Claude Opus 5.5 --- .github/justfile | 4 --- .github/workflows/alert.yml | 1 - .github/workflows/back-merge.yml | 51 ---------------------------- sh/gh/back-merge.sh | 57 -------------------------------- 4 files changed, 113 deletions(-) delete mode 100644 .github/workflows/back-merge.yml delete mode 100755 sh/gh/back-merge.sh diff --git a/.github/justfile b/.github/justfile index f73be6168b..1bccfc5338 100644 --- a/.github/justfile +++ b/.github/justfile @@ -34,10 +34,6 @@ formula *args: install-formula *args: python3 sh/gh/install-formula.py "$@" -# Open the pull request that merges `release` back into `main`, queued to land as a merge commit. -back-merge: - sh/gh/back-merge.sh - # Trigger the apt-repo and rpm-repo workflows for a release tag. [positional-arguments] trigger-repo-publish *args: diff --git a/.github/workflows/alert.yml b/.github/workflows/alert.yml index d0134bcb4d..2c4084d32e 100644 --- a/.github/workflows/alert.yml +++ b/.github/workflows/alert.yml @@ -28,7 +28,6 @@ on: # request. workflows: - apt-repo - - Back-merge - Cache - Cachix - Docker diff --git a/.github/workflows/back-merge.yml b/.github/workflows/back-merge.yml deleted file mode 100644 index e03ac6a2b3..0000000000 --- a/.github/workflows/back-merge.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Back-merge - -# Every push to `release` (a cut, a backport, or release-plz's version bump) -# merges `release` back into `main`, so trunk carries the published versions -# and CHANGELOGs and the next cut starts from an advanced merge base. -# -# It lands through a pull request as a merge commit, never a squash: a squash -# leaves the merge base at the last cut, so a second publish before the next -# cut would conflict. - -on: - push: - branches: [release] - # Re-running by hand, e.g. after resolving a conflict that failed a run. - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: back-merge - cancel-in-progress: false - -jobs: - back-merge: - name: Back-merge - runs-on: ubuntu-latest - if: github.repository_owner == 'moq-dev' - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - uses: ./.github/actions/just - - # The app token, not GITHUB_TOKEN: a pull request GITHUB_TOKEN opens - # triggers no workflows, so Check and Test would never report. - - name: Generate moq-bot token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 - id: token - with: - client-id: ${{ secrets.APP_CLIENT_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - permission-contents: write - permission-pull-requests: write - - - name: Merge release into main - env: - GH_TOKEN: ${{ steps.token.outputs.token }} - run: just gh back-merge diff --git a/sh/gh/back-merge.sh b/sh/gh/back-merge.sh deleted file mode 100755 index 2a7142b42f..0000000000 --- a/sh/gh/back-merge.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash -# -# Open (or refresh) the pull request that merges `release` back into `main`. -# Check's `land` job merges it as a merge commit once Check and Test pass on its -# head, bypassing the squash-only merge queue. -# -# The pull request's head is its own branch rather than `release` itself: the -# repository deletes head branches on merge, and a conflict is resolved by -# merging `main` into that branch, which must never touch `release`. -# -# Required env: -# GH_TOKEN A token whose pull requests trigger CI (not GITHUB_TOKEN). -# GITHUB_REPOSITORY owner/repo, set by GitHub Actions. - -set -euo pipefail - -repo="${GITHUB_REPOSITORY:?GITHUB_REPOSITORY must be set}" -branch=merge/release-into-main - -ahead=$(gh api "repos/$repo/compare/main...release" --jq .ahead_by) -if [[ "$ahead" == 0 ]]; then - echo "main already contains release" - exit 0 -fi - -sha=$(gh api "repos/$repo/git/ref/heads/release" --jq .object.sha) - -# --exit-code: 2 means the branch is absent; anything else nonzero is a failure. -status=0 -git ls-remote --exit-code --heads "https://github.com/$repo" "$branch" >/dev/null || status=$? -case "$status" in - 0) - # An open pull request may carry a hand-resolved conflict, so merge into the - # branch instead of resetting it. A conflict fails here, loudly. - gh api -X POST "repos/$repo/merges" -f base="$branch" -f head="$sha" \ - -f commit_message="Merge release into $branch" >/dev/null - ;; - 2) - gh api -X POST "repos/$repo/git/refs" -f ref="refs/heads/$branch" -f sha="$sha" >/dev/null - ;; - *) - echo "error: cannot query $branch on $repo" >&2 - exit 1 - ;; -esac - -# Only a pull request from this repository's own branch: `gh pr list --head` -# matches the branch name alone, so a fork's branch of the same name would pass. -pr=$(gh api "repos/$repo/pulls?state=open&base=main&head=${repo%%/*}:$branch" \ - --jq "[.[] | select(.head.repo.full_name == \"$repo\")][0].number // empty") -if [[ -z "$pr" ]]; then - gh pr create --repo "$repo" --head "$branch" --base main \ - --title "chore: merge release into main" \ - --body "Carries what \`release\` published (versions, CHANGELOGs, backports) back to trunk. Opened by the Back-merge workflow. - -Check's \`land\` job merges it as a merge commit once Check and Test pass. **Never squash.** A squash leaves the merge base at the last cut, so the next back-merge conflicts. On a conflict, merge \`main\` into \`$branch\` and resolve it there." -fi