From 0a4cdafe23c73af56d3b641d7fdbb30347836231 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 7 Mar 2026 05:54:37 +0100 Subject: [PATCH] workflows: auto-approve renovate yarn.lock PRs Use the service account workflow to auto-approve Renovate PRs that only change yarn.lock files. Signed-off-by: Patrik Oldsberg Made-with: Cursor --- .../workflows/sync_renovate-changesets.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/sync_renovate-changesets.yml b/.github/workflows/sync_renovate-changesets.yml index 8575cab760..0940de9c55 100644 --- a/.github/workflows/sync_renovate-changesets.yml +++ b/.github/workflows/sync_renovate-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: