From 993ae652c7916ee44843305a884d97597014e768 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Tue, 30 Jun 2026 09:35:50 +0200 Subject: [PATCH 1/2] ci: scope workflow to pull_request only, eliminating duplicate runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous trigger `on: [push, pull_request]` caused CI to run twice on every PR — once from the push event on the branch, once from the pull_request event. By scoping to pull_request only, CI runs once per PR and no longer wastefully duplicates work. Also removes push-to-master CI — once branch protection requiring green builds is in place, every merge to master is guaranteed clean, making push-triggered CI on master redundant. Adds workflow_dispatch to allow manual CI triggering when needed. --- .github/workflows/ruby.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 6b2418d5d..7bc99fa33 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,6 +1,9 @@ name: CI -on: [ push, pull_request ] +on: + pull_request: + branches: [ master ] + workflow_dispatch: jobs: test: From e74c52c342fe18294d8db5ab425e55184b065fbf Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Tue, 30 Jun 2026 09:36:02 +0200 Subject: [PATCH 2/2] ci: cancel in-progress CI on new commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a concurrency group keyed on the git ref so that pushing new commits to a PR branch cancels any in-progress CI run for that branch. Prevents wasted compute when iterating quickly — only the latest commit's CI result matters. --- .github/workflows/ruby.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 7bc99fa33..9571825ca 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,5 +1,9 @@ name: CI +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + on: pull_request: branches: [ master ]