Skip to content

Commit 0678dd3

Browse files
committed
fix: do not trigger build workflows after merging to main or for release PRs
Since all merges to the main branch must be a fast-forward rebase, CI builds should not be run when merged to main. They are run via the pull request before merging. The continuous_integration workflow should be triggered for pull requests targeting main. The experimental_ruby_builds workflow should only be triggered manually via the GitHub UI
1 parent ae04872 commit 0678dd3

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Continuous Integration
22

33
on:
4-
push:
5-
branches: [main]
6-
74
pull_request:
85
branches: [main]
96

@@ -26,6 +23,10 @@ jobs:
2623
build:
2724
name: Ruby ${{ matrix.ruby }} on ${{ matrix.operating-system }}
2825

26+
if: >-
27+
github.event_name == 'workflow_dispatch' ||
28+
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
29+
2930
runs-on: ${{ matrix.operating-system }}
3031
continue-on-error: true
3132

.github/workflows/enforce_conventional_commits.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ jobs:
99
commit-lint:
1010
name: Verify Conventional Commits
1111

12+
if: >-
13+
github.event_name == 'workflow_dispatch' ||
14+
(github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--'))
15+
1216
runs-on: ubuntu-latest
1317

1418
steps:

.github/workflows/experimental_ruby_builds.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Experimental Ruby Builds
22

33
on:
4-
push:
5-
branches: [main]
6-
74
workflow_dispatch:
85

96
env:

0 commit comments

Comments
 (0)