From 4b327a3b5c2d73c409e39c0fd887bd3597412d53 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Sat, 27 Jun 2026 10:06:58 +0300 Subject: [PATCH] ci: stop double-running test workflows on PR branches All seven test-* workflows triggered on both push and pull_request with no branch filter, so every push to a PR branch fired both events: two runs each. Restrict push to main: PR branches now trigger only pull_request, and a merge to main triggers only push. pull_request stays unfiltered so PRs against any base still run. Roughly halves Actions usage for these workflows. --- .github/workflows/test-breaking.yaml | 3 ++- .github/workflows/test-changelog.yaml | 3 ++- .github/workflows/test-diff.yaml | 3 ++- .github/workflows/test-error-annotation.yaml | 3 ++- .github/workflows/test-pr-comment.yaml | 3 ++- .github/workflows/test-validate.yaml | 3 ++- .github/workflows/test-verify.yaml | 1 + 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-breaking.yaml b/.github/workflows/test-breaking.yaml index f6ad422..1d88bdf 100644 --- a/.github/workflows/test-breaking.yaml +++ b/.github/workflows/test-breaking.yaml @@ -1,7 +1,8 @@ name: breaking on: - pull_request: push: + branches: [main] + pull_request: jobs: oasdiff_breaking: runs-on: ubuntu-latest diff --git a/.github/workflows/test-changelog.yaml b/.github/workflows/test-changelog.yaml index e330b38..ed7fe83 100644 --- a/.github/workflows/test-changelog.yaml +++ b/.github/workflows/test-changelog.yaml @@ -1,7 +1,8 @@ name: changelog on: - pull_request: push: + branches: [main] + pull_request: jobs: oasdiff_changelog: runs-on: ubuntu-latest diff --git a/.github/workflows/test-diff.yaml b/.github/workflows/test-diff.yaml index b476114..d5cd1df 100644 --- a/.github/workflows/test-diff.yaml +++ b/.github/workflows/test-diff.yaml @@ -1,7 +1,8 @@ name: diff on: - pull_request: push: + branches: [main] + pull_request: jobs: oasdiff_diff: runs-on: ubuntu-latest diff --git a/.github/workflows/test-error-annotation.yaml b/.github/workflows/test-error-annotation.yaml index e290d57..b4537f4 100644 --- a/.github/workflows/test-error-annotation.yaml +++ b/.github/workflows/test-error-annotation.yaml @@ -1,7 +1,8 @@ name: error-annotation on: - pull_request: push: + branches: [main] + pull_request: jobs: entrypoint_error_annotation: runs-on: ubuntu-latest diff --git a/.github/workflows/test-pr-comment.yaml b/.github/workflows/test-pr-comment.yaml index 4c21ee8..5fd91df 100644 --- a/.github/workflows/test-pr-comment.yaml +++ b/.github/workflows/test-pr-comment.yaml @@ -1,7 +1,8 @@ name: pr-comment on: - pull_request: push: + branches: [main] + pull_request: jobs: pr_comment_tolerates_oasdiff_fail_on: runs-on: ubuntu-latest diff --git a/.github/workflows/test-validate.yaml b/.github/workflows/test-validate.yaml index 2f31497..fe9ed2d 100644 --- a/.github/workflows/test-validate.yaml +++ b/.github/workflows/test-validate.yaml @@ -1,7 +1,8 @@ name: validate on: - pull_request: push: + branches: [main] + pull_request: jobs: oasdiff_validate_valid: runs-on: ubuntu-latest diff --git a/.github/workflows/test-verify.yaml b/.github/workflows/test-verify.yaml index 4ab7574..4d672ae 100644 --- a/.github/workflows/test-verify.yaml +++ b/.github/workflows/test-verify.yaml @@ -1,6 +1,7 @@ name: test verify on: push: + branches: [main] pull_request: jobs: