From 28e19b55d20dbbb7b6db251151b39db8da2c0842 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Thu, 2 Jul 2026 13:19:35 -0500 Subject: [PATCH] CI: auto-update open PR branches via autoupdate Action (#20) Add .github/workflows/autoupdate.yml. On every push to main, the chinthakagodawita/autoupdate action merges main into all open PRs that target it (PR_FILTER: "all"), keeping branches current as PRs merge. The action is pinned to commit 0707656 (v1.7.0) for supply-chain safety. Uses the default GITHUB_TOKEN with minimal contents:write and pull-requests:write permissions. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/autoupdate.yml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/autoupdate.yml diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml new file mode 100644 index 0000000..a50309e --- /dev/null +++ b/.github/workflows/autoupdate.yml @@ -0,0 +1,34 @@ +# Automatically keep open PR branches up to date with main. +# +# Whenever a commit lands on main (typically when a PR merges), the +# chinthakagodawita/autoupdate action merges the latest main into every open PR +# that targets main, so PR branches don't drift out of date. +# +# Known trade-off: the update push is made using the default GITHUB_TOKEN, and +# pushes made with GITHUB_TOKEN do NOT re-trigger downstream workflow runs. So +# CI will not automatically re-run purely as a result of an autoupdate push -- +# a manual push or a re-run is needed to re-trigger checks on the updated branch. + +name: Autoupdate PR branches + +on: + push: + branches: [main] + +# Minimal permissions needed to update open PR branches. +permissions: + contents: write + pull-requests: write + +jobs: + autoupdate: + runs-on: ubuntu-latest + steps: + # Pinned to a specific commit SHA (supply-chain safety); comment tracks the + # human-readable release it corresponds to. + - name: Autoupdate open PRs + uses: chinthakagodawita/autoupdate@0707656cd062a3b0cf8fa9b2cda1d1404d74437e # v1.7.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Update all open PRs targeting the pushed branch. + PR_FILTER: "all" -- 2.47.3