Skip to content

Commit

Permalink
prevent actions from running twice when pushing to PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
schlimmchen committed Sep 27, 2024
1 parent 5d8bb8f commit aa159fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cpplint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest

# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null
# prevent push event from triggering if it's part of a local PR, see
# https://github.com/orgs/community/discussions/57827#discussioncomment-6579237
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/yarnlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest

# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null
# prevent push event from triggering if it's part of a local PR, see
# https://github.com/orgs/community/discussions/57827#discussioncomment-6579237
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

defaults:
run:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/yarnprettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ jobs:
build:
runs-on: ubuntu-latest

# prevent push event from triggering if it's part of a PR
if: github.event_name != 'push' || github.event.pull_request == null
# prevent push event from triggering if it's part of a local PR, see
# https://github.com/orgs/community/discussions/57827#discussioncomment-6579237
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name

defaults:
run:
Expand Down

0 comments on commit aa159fd

Please sign in to comment.