Skip to content

Commit 3f3d98a

Browse files
Limit the circumstances in which CI is kicked off (#600)
With the previous spelling, if a forked version of FCL had actions enabled, then every push to every branch would kick off a mac/ubuntu CI event. This is ridiculous and telling forkers to not allow github actions is not the solution. So, we take two strategies to spare the FCL contributors: 1. We limit the CI to operate only on the master branch. 2. The CI tasks become no-ops unless it is run on the FCL repo. This will still cause actions to be triggered, but they will silently do nothing in zero time.
1 parent 8d46ae7 commit 3f3d98a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/all_ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ run-name: Mac and Linux CI
99
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-paths
1010
# There is a solution if this type of optimization is preferred. See:
1111
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
12-
on: [push, pull_request]
12+
on:
13+
push:
14+
branches:
15+
- master
16+
pull_request:
17+
branches:
18+
- master
1319

1420
# This allows a subsequently queued workflow run to interrupt previous runs.
1521
concurrency:

.github/workflows/generic_ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
common-build-and-test:
2121
name: ci
2222
runs-on: ${{ inputs.os }}
23+
# Don't inflict actual CI work on forks that happen to have actions enabled.
24+
if: github.repository_owner == 'flexible-collision-library'
2325
env:
2426
CC: ${{ inputs.compiler == 'gcc' && 'gcc' || 'clang' }}
2527
CXX: ${{ inputs.compiler == 'gcc' && 'g++' || 'clang++' }}

0 commit comments

Comments
 (0)