From 2b1c2a97cc3176fe98ecdd9c7c0c1ed520af819b Mon Sep 17 00:00:00 2001 From: Nicholas Devenish Date: Fri, 6 Nov 2026 16:49:36 +0000 Subject: [PATCH] CI: Don't run tests twice on pull request branches The workflow ran on every push and every pull_request, so each push to a branch with an open PR in this repository triggered two identical runs. Restrict push runs to main and tags (tags are needed for the pypi-publish job); pull requests are still tested via pull_request. --- .github/workflows/python.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index bb173eb..bf16f76 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,6 +1,13 @@ name: Build and Test -on: [push, pull_request] +on: + # Pushes to PR branches are covered by the pull_request event; running + # on every push as well would test each PR twice. Tags must be kept so + # that the pypi-publish job runs on release. + push: + branches: [main] + tags: ["*"] + pull_request: jobs: build: