Skip to content

Limit push builds to the main branch #527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Limit push builds to the main branch #527

merged 1 commit into from
Feb 7, 2025

Conversation

neilvcarvalho
Copy link
Member

@neilvcarvalho neilvcarvalho commented Jan 31, 2025

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.

image

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.

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.
@neilvcarvalho
Copy link
Member Author

Proof this is working: past commits were triggering 18 checks, and this one is triggering 9 checks 😁

@neilvcarvalho neilvcarvalho merged commit 9216916 into main Feb 7, 2025
9 checks passed
@neilvcarvalho neilvcarvalho deleted the nc-build-once branch February 7, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant