Skip to content

Commit b736406

Browse files
authored
Merge pull request #169 from adnanaziz/restrict-ci
Restrict CI to the main repository only
2 parents 16e3528 + d0a7b14 commit b736406

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/test_cpp_cmake.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: Fast Test
2929
runs-on: ubuntu-latest
3030
# Skip on PR if branch is of the same repo (checks are already enabled by push rule)
31-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
31+
if: github.repository == 'adnanaziz/EPIJudge' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
3232

3333
strategy:
3434
matrix:
@@ -80,7 +80,7 @@ jobs:
8080
name: Windows Test
8181
needs: fast_test
8282
runs-on: windows-latest
83-
if: github.event_name == 'push' && github.event.ref == 'refs/tags/full-ci' && github.event.deleted == false
83+
if: github.repository == 'adnanaziz/EPIJudge' && (github.event_name == 'push' && github.event.ref == 'refs/tags/full-ci' && github.event.deleted == false)
8484

8585
strategy:
8686
matrix:
@@ -125,7 +125,7 @@ jobs:
125125
name: macOS Test
126126
needs: windows_test
127127
runs-on: macOS-latest
128-
if: github.event_name == 'push' && github.event.ref == 'refs/tags/full-ci' && github.event.deleted == false
128+
if: github.repository == 'adnanaziz/EPIJudge' && (github.event_name == 'push' && github.event.ref == 'refs/tags/full-ci' && github.event.deleted == false)
129129

130130
strategy:
131131
matrix:
@@ -168,7 +168,7 @@ jobs:
168168
name: Empty check
169169
runs-on: ubuntu-latest
170170
# Add a dummy job to avoid empty job list (otherwise GitHub shows the runs as failed)
171-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
171+
if: github.repository != 'adnanaziz/EPIJudge' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
172172
steps:
173173
- name: This check is triggered by the corresponding push event
174174
run: echo 'This check is triggered by the corresponding push event'

.github/workflows/test_java_make.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
name: Fast Test
2626
runs-on: ubuntu-latest
2727
# Skip on PR if branch is of the same repo (checks are already enabled by push rule)
28-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
28+
if: github.repository == 'adnanaziz/EPIJudge' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
2929

3030
strategy:
3131
matrix:
@@ -60,7 +60,7 @@ jobs:
6060
name: Full Test
6161
needs: fast_test
6262
runs-on: windows-latest
63-
if: github.event_name == 'push' && github.event.ref == 'refs/tags/full-ci' && github.event.deleted == false
63+
if: github.repository == 'adnanaziz/EPIJudge' && (github.event_name == 'push' && github.event.ref == 'refs/tags/full-ci' && github.event.deleted == false)
6464

6565
strategy:
6666
matrix:
@@ -95,7 +95,7 @@ jobs:
9595
name: Empty check
9696
runs-on: ubuntu-latest
9797
# Add a dummy job to avoid empty job list (otherwise GitHub shows the runs as failed)
98-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
98+
if: github.repository != 'adnanaziz/EPIJudge' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
9999
steps:
100100
- name: This check is triggered by the corresponding push event
101101
run: echo 'This check is triggered by the corresponding push event'

0 commit comments

Comments
 (0)