Skip to content

Commit 40190fb

Browse files
authored
Fix #904: test that repo owner is Quantumlib (#968)
This adds checks to the GitHub Actions workflows for the owner being Quantumlib, so that users who fork the repo will not be surprised by the workflows running in their forks.
1 parent 1438bad commit 40190fb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
9393
docker-lint:
9494
name: Dockerfile lint checks
95+
if: github.repository_owner == 'quantumlib'
9596
# ubuntu-slim runners don't have docker installed.
9697
runs-on: ubuntu-24.04
9798
timeout-minutes: 15
@@ -114,6 +115,7 @@ jobs:
114115
115116
shell-lint:
116117
name: Shell script lint checks
118+
if: github.repository_owner == 'quantumlib'
117119
runs-on: ubuntu-slim
118120
timeout-minutes: 15
119121
steps:
@@ -136,6 +138,7 @@ jobs:
136138
137139
yaml-lint:
138140
name: YAML lint checks
141+
if: github.repository_owner == 'quantumlib'
139142
runs-on: ubuntu-slim
140143
timeout-minutes: 15
141144
steps:
@@ -160,6 +163,7 @@ jobs:
160163
161164
bazel-lint:
162165
name: Bazel build lint checks
166+
if: github.repository_owner == 'quantumlib'
163167
runs-on: ubuntu-slim
164168
timeout-minutes: 15
165169
steps:
@@ -183,6 +187,7 @@ jobs:
183187
184188
action-lint:
185189
name: GitHub Actions lint checks
190+
if: github.repository_owner == 'quantumlib'
186191
runs-on: ubuntu-slim
187192
timeout-minutes: 15
188193
steps:
@@ -201,6 +206,7 @@ jobs:
201206

202207
library-tests:
203208
name: Library tests
209+
if: github.repository_owner == 'quantumlib'
204210
needs:
205211
- action-lint
206212
- bazel-lint
@@ -297,6 +303,7 @@ jobs:
297303
298304
options-tests:
299305
name: Options tests
306+
if: github.repository_owner == 'quantumlib'
300307
needs:
301308
- action-lint
302309
- bazel-lint
@@ -352,6 +359,7 @@ jobs:
352359
353360
memory-tests:
354361
name: Malloc/asan/msan tests
362+
if: github.repository_owner == 'quantumlib'
355363
needs:
356364
- action-lint
357365
- bazel-lint
@@ -407,6 +415,7 @@ jobs:
407415

408416
docker-tests:
409417
name: Docker build tests
418+
if: github.repository_owner == 'quantumlib'
410419
needs:
411420
- action-lint
412421
- docker-lint
@@ -448,7 +457,7 @@ jobs:
448457

449458
report-results:
450459
name: CI
451-
if: always()
460+
if: always() && github.repository_owner == 'quantumlib'
452461
needs:
453462
- action-lint
454463
- bazel-lint

.github/workflows/cirq_compatibility.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ concurrency:
3535

3636
jobs:
3737
test-compatibility:
38+
if: github.repository_owner == 'quantumlib'
3839
name: Test Cirq compatibility
3940
runs-on: ubuntu-24.04
4041
timeout-minutes: 30

0 commit comments

Comments
 (0)