Skip to content

Commit 7c8fe9f

Browse files
committed
Limit push builds to the main branch
GitHub Actions has been running the lint twice in Pull Requests: once following the `on push` trigger, once following `on pull_request`. This duplication is currently avoided when running tests by an `if` rule, which skips if the event isn't a push or the Pull Request doesn't come from a fork. This commit removes the `if` rule, and limits the `push` builds to the `main` branch. That will ensure that merged Pull Requests will trigger a build, and that any Pull Request activity will also trigger a build. Being a global rule for the whole build, `standard` will not run twice anymore.
1 parent afd6d25 commit 7c8fe9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Build
22
on:
3-
- push
4-
- pull_request
3+
pull_request:
4+
push:
5+
branches: [ main ]
56

67
jobs:
78
build:
89
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
9-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
1010
strategy:
1111
fail-fast: false
1212
matrix:

0 commit comments

Comments
 (0)