diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 74da403..3e632b0 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -11,14 +11,20 @@ name: Dependabot auto-merge on: pull_request +# Read-only by default; the one job that needs it grants itself the minimum below. permissions: - contents: write # enable auto-merge on the PR - pull-requests: write # required by gh pr merge + contents: read jobs: auto-merge: if: github.actor == 'dependabot[bot]' runs-on: ubuntu-latest + timeout-minutes: 5 + # Scoped to the job, not the workflow: enabling auto-merge is a pull-request + # write, and the merge itself is performed later by GitHub, so nothing here + # needs contents: write (least privilege). + permissions: + pull-requests: write steps: - name: Fetch Dependabot metadata id: meta