From e17ca0a641a7590785932083727adca03886eb5c Mon Sep 17 00:00:00 2001 From: nx-thaddeusaid Date: Sun, 24 May 2026 14:40:01 -0700 Subject: [PATCH] ci: keep dependabot-reqs in sync with main Merge main into dependabot-reqs on every push to main (and on demand) so Dependabot's weekly updates are computed against the latest manifests. Uses merge rather than rebase/force-push because dependabot-reqs is the base of open Dependabot PRs and its tip must only advance. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/sync-dependabot-reqs.yml | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/sync-dependabot-reqs.yml diff --git a/.github/workflows/sync-dependabot-reqs.yml b/.github/workflows/sync-dependabot-reqs.yml new file mode 100644 index 0000000..397feb5 --- /dev/null +++ b/.github/workflows/sync-dependabot-reqs.yml @@ -0,0 +1,47 @@ +name: Keep dependabot-reqs in sync with main + +# Dependabot computes its updates against the manifests on its target branch +# (dependabot-reqs, set in .github/dependabot.yml). This workflow merges main +# into dependabot-reqs whenever main changes, so the weekly recommendations are +# always evaluated against the latest package.json / lockfile. +# +# Uses a merge (not a rebase/force-push): dependabot-reqs is the *base* of open +# Dependabot PRs, so its tip must only ever advance, never be rewritten. + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: sync-dependabot-reqs + cancel-in-progress: false + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout dependabot-reqs + uses: actions/checkout@v4 + with: + ref: dependabot-reqs + fetch-depth: 0 + + - name: Merge main into dependabot-reqs + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git fetch origin main + if git merge-base --is-ancestor origin/main HEAD; then + echo "dependabot-reqs already contains main; nothing to sync." + exit 0 + fi + if ! git merge --no-edit origin/main; then + echo "::error::Merge conflict syncing main into dependabot-reqs — resolve manually (likely a manifest edited on both branches)." + git merge --abort + exit 1 + fi + git push origin HEAD:dependabot-reqs