From 040551d99bb1ee36c53efe155f346a8248be72c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 11 Mar 2026 11:20:17 +0100 Subject: [PATCH] chore(ci): auto-approve yarn.lock-only dependabot PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the same auto-approval step that the renovate workflow already has, so that dependabot PRs that only touch yarn.lock files get approved automatically. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Fredrik Adelöw --- .../workflows/sync_dependabot-changesets.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/sync_dependabot-changesets.yml b/.github/workflows/sync_dependabot-changesets.yml index 8768aff21a..14d2a4d630 100644 --- a/.github/workflows/sync_dependabot-changesets.yml +++ b/.github/workflows/sync_dependabot-changesets.yml @@ -15,6 +15,29 @@ jobs: with: egress-policy: audit + - name: Approve yarn.lock-only PRs + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} + script: | + const { data: files } = await github.rest.pulls.listFiles({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + + if (files.some(file => !file.filename.endsWith("yarn.lock"))) { + console.log("Skipping approval since some files are not yarn.lock"); + return; + } + + await github.rest.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + event: "APPROVE", + }); + - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: