Skip to content

Commit 9216916

Browse files
Limit push builds to the main branch (#527)
Commits to a Pull Request branch have been triggering a build twice. That is happening because a `push` to a pull request is both a `push` and a `pull_request` activity. This commit fixes this issue by limiting the `push` trigger to the `main` branch, ensuring that merged Pull Requests will run linting and tests on the main branch, and that any Pull Request activity will also trigger a build.
1 parent ec989aa commit 9216916

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/build.yml

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

67
jobs:
78
build:

0 commit comments

Comments
 (0)