diff --git a/.github/workflows/dependabot-reminders.yml b/.github/workflows/dependabot-reminders.yml index 055363b..e92e9d1 100644 --- a/.github/workflows/dependabot-reminders.yml +++ b/.github/workflows/dependabot-reminders.yml @@ -2,13 +2,16 @@ # needs (files Dependabot can't change, hardware checks, release side effects). # The rules live in .github/scripts/dependabot-reminders.js. # -# Runs on pull_request_target so the token can comment on Dependabot PRs. It -# only checks out the base branch and reads the PR's file list through the API; -# never check out or run the PR's code here. +# Runs on pull_request, not pull_request_target: GitHub blocks +# pull_request_target in public repos by default. For Dependabot's own +# branches the `permissions` below still give the token write access to post +# the comment (fork PRs get a read-only token, but the job skips them anyway). +# It only checks out the base commit and reads the PR's file list through the +# API; never check out or run the PR's code here. name: Dependabot reminders on: - pull_request_target: + pull_request: types: [opened, synchronize, reopened] permissions: @@ -20,9 +23,10 @@ jobs: if: github.event.pull_request.user.login == 'dependabot[bot]' runs-on: ubuntu-latest steps: - # The base branch, so the rules come from main and not from the PR. + # The base commit, so the rules come from main and not from the PR. - uses: actions/checkout@v7 with: + ref: ${{ github.event.pull_request.base.sha }} sparse-checkout: .github/scripts persist-credentials: false