Skip to content

Commit 5845160

Browse files
authored
Restrict C++ CI to the main repository only
1 parent 16e3528 commit 5845160

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
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'

0 commit comments

Comments
 (0)