From bc46f2b01f684c7f169297889e05609c91df66ae Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Fri, 28 Aug 2026 09:43:31 -0400 Subject: [PATCH] Run CI on pull requests only, and bound every job Every branch-triggered workflow also had a pull_request trigger, so a PR from a same-repo branch ran the whole suite twice. Release workflows keep their tag trigger, and scorecard.yml keeps its branch push because OpenSSF Scorecard needs that event to publish results. Jobs had no timeout-minutes, so each inherited the 360-minute default; a job that hangs on an API call could burn six hours unnoticed. Concurrency stops superseded runs, except on publishing workflows, where cancelling a half-finished release is worse than letting it finish. --- .github/workflows/benchmark-comment.yml | 5 +++++ .github/workflows/benchmark.yml | 4 ++++ .github/workflows/fix-php-code-style-issues.yml | 8 ++++---- .github/workflows/laravel-13-dev.yml | 4 ++++ .github/workflows/mutation.yml | 4 ++++ .github/workflows/phpstan.yml | 10 ++++------ .github/workflows/rector.yml | 9 ++++----- .github/workflows/release.yml | 5 +++++ .github/workflows/run-tests.yml | 7 ------- .github/workflows/tag-currency.yml | 7 ++++--- .github/workflows/update-changelog.yml | 5 +++++ 11 files changed, 43 insertions(+), 25 deletions(-) diff --git a/.github/workflows/benchmark-comment.yml b/.github/workflows/benchmark-comment.yml index aab8dc2..87eeecf 100644 --- a/.github/workflows/benchmark-comment.yml +++ b/.github/workflows/benchmark-comment.yml @@ -5,12 +5,17 @@ on: workflows: [Benchmark] types: [completed] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: comment: if: > github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' runs-on: ubuntu-latest + timeout-minutes: 15 permissions: actions: read pull-requests: write diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index bcdcc0f..e7da8b9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -10,6 +10,10 @@ on: - 'benchmark.php' - '.github/workflows/benchmark.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: benchmark: runs-on: ubuntu-latest diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index d113c24..e8d6c80 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -1,15 +1,15 @@ name: Fix PHP code style issues on: - push: - paths: - - '**.php' - - 'pint.json' pull_request: paths: - '**.php' - 'pint.json' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: write diff --git a/.github/workflows/laravel-13-dev.yml b/.github/workflows/laravel-13-dev.yml index dd3d29c..c37c283 100644 --- a/.github/workflows/laravel-13-dev.yml +++ b/.github/workflows/laravel-13-dev.yml @@ -28,6 +28,10 @@ on: - cron: '0 6 * * *' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: # Silence forks — only run on the canonical repo. diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 916070e..4e71ac0 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -17,6 +17,10 @@ on: schedule: - cron: "0 6 * * 1" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: pest-mutate: runs-on: ubuntu-latest diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index e7cf44f..866781c 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -4,12 +4,6 @@ permissions: contents: read on: - push: - paths: - - '**.php' - - 'phpstan.neon.dist' - - 'phpstan-baseline.neon' - - '.github/workflows/phpstan.yml' pull_request: paths: - '**.php' @@ -17,6 +11,10 @@ on: - 'phpstan-baseline.neon' - '.github/workflows/phpstan.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: phpstan: name: phpstan diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 74ba026..25e4c0c 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -1,17 +1,16 @@ name: Rector on: - push: - paths: - - '**.php' - - 'rector.php' - - '.github/workflows/rector.yml' pull_request: paths: - '**.php' - 'rector.php' - '.github/workflows/rector.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 812a8ee..205988f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,14 @@ on: tags: - "v[0-9]+.[0-9]+.[0-9]+" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: release: runs-on: ubuntu-latest + timeout-minutes: 30 permissions: contents: write diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9d9eacf..d5eb9f9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -4,13 +4,6 @@ permissions: contents: read on: - push: - paths: - - '**.php' - - '.github/workflows/run-tests.yml' - - 'phpunit.xml.dist' - - 'composer.json' - - 'composer.lock' pull_request: paths: - '**.php' diff --git a/.github/workflows/tag-currency.yml b/.github/workflows/tag-currency.yml index 3d1fb81..840dc55 100644 --- a/.github/workflows/tag-currency.yml +++ b/.github/workflows/tag-currency.yml @@ -12,9 +12,6 @@ permissions: # because a tag can also be moved or deleted directly on the remote, which no # push to this repository would notice. on: - push: - branches: - - main pull_request: schedule: # Monday 06:00 America/New_York, matching the Dependabot window. Cron has no @@ -23,6 +20,10 @@ on: - cron: '0 11 * * 1' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: tag-currency: name: tag currency diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index c6051eb..3227109 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -4,9 +4,14 @@ on: release: types: [released] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: update: runs-on: ubuntu-latest + timeout-minutes: 15 permissions: contents: write