From 9e390a622836f9b57300a693c511cf3a3bcf9138 Mon Sep 17 00:00:00 2001 From: Neil Carvalho Date: Fri, 31 Jan 2025 15:20:41 -0300 Subject: [PATCH] Limit `push` builds to the `main` branch 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. --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ffa565a..2854172 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,8 @@ name: Build on: - - push - - pull_request + pull_request: + push: + branches: [ main ] jobs: build: