Skip to content

Commit 3db7caf

Browse files
authored
Merge pull request #4219 from github/mbg/ci/improve-pr-checks-triggers
Improve `pr-checks.yml` triggers and conditions
2 parents 83e1837 + d63cb97 commit 3db7caf

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎.github/workflows/pr-checks.yml‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: PR Checks
22

33
on:
44
push:
5+
branches:
6+
- "main"
7+
- "releases/v*"
58
pull_request:
69
merge_group:
710
types: [checks_requested]
@@ -145,12 +148,11 @@ jobs:
145148
146149
- name: Fetch base commit
147150
id: fetch-base
148-
# Forks and Dependabot PRs don't have permission to write comments, so skip the repo size
149-
# check in those cases.
151+
# Skip this (and subsequent steps) if the PR originates from a fork, since this workflow
152+
# won't have the necessary permissions to post comments on the PR.
150153
if: >-
151154
github.event_name == 'pull_request' &&
152-
github.event.pull_request.head.repo.full_name == github.repository &&
153-
github.event.pull_request.user.login != 'dependabot[bot]'
155+
github.event.pull_request.head.repo.full_name == github.repository
154156
env:
155157
BASE_SHA: ${{ github.event.pull_request.base.sha }}
156158
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
@@ -209,7 +211,7 @@ jobs:
209211
if: >-
210212
github.event_name == 'pull_request' &&
211213
github.event.pull_request.head.repo.full_name == github.repository &&
212-
github.event.pull_request.user.login != 'dependabot[bot]' &&
214+
github.actor != 'dependabot[bot]' &&
213215
needs.other-checks.result == 'success'
214216
permissions:
215217
contents: read

0 commit comments

Comments
 (0)