diff --git a/.github/workflows/discord-notify.yml b/.github/workflows/discord-notify.yml index 81043f3..3b7d413 100644 --- a/.github/workflows/discord-notify.yml +++ b/.github/workflows/discord-notify.yml @@ -4,10 +4,10 @@ on: issues: # No `assigned` on purpose: taking an issue is not announced on Discord. types: [closed, unlabeled, edited] - # pull_request_target (not pull_request) so notifications also work for PRs opened - # from forks, which are not given access to secrets. Safe here because the job only - # ever runs code from the base branch — it never checks out the PR's own code. - pull_request_target: + # pull_request, not pull_request_target: GitHub now blocks pull_request_target on + # public repositories by default. PRs from forks get no secrets with pull_request, + # so the job below skips them. + pull_request: # ready_for_review pairs with opened: drafts are skipped when they appear and # announced when the author says they are ready, so neither is missed or early. types: [opened, ready_for_review, review_requested, closed] @@ -25,6 +25,8 @@ permissions: jobs: notify: + # Skip PRs and reviews from forks: their runs get no secrets, so the bot would fail. + if: github.event_name == 'issues' || github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest timeout-minutes: 5 steps: