Skip to content

Commit c255021

Browse files
Michael Vasseurvmcj
authored andcommitted
Don't run this on branches in our own org
We would trigger both on push and pull_request, skip the 2nd one. So we either run when this is a push in our organisation but not to main, OR if this is a pull_request from another organisation/user to domjudge_org.
1 parent da759fc commit c255021

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/build-contributor-container-PR.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ on:
1010

1111
jobs:
1212
pr-contributor:
13-
if: ${{ github.repository != 'domjudge/domjudge-packaging' || github.ref != 'refs/heads/main' }}
13+
if: ${{ !(github.repository == 'domjudge/domjudge-packaging' &&
14+
github.ref == 'refs/heads/main') &&
15+
(github.event_name == 'pull_request_target' ||
16+
github.event.pull_request.head.repo.full_name != github.repository) }}
1417
runs-on: ubuntu-latest
1518
steps:
1619
- name: Checkout

.github/workflows/build-domjudge-container-PR.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ env:
1111

1212
jobs:
1313
pr-domjudge:
14-
if: ${{ github.repository != 'domjudge/domjudge-packaging' || github.ref != 'refs/heads/main' }}
14+
if: ${{ !(github.repository == 'domjudge/domjudge-packaging' &&
15+
github.ref == 'refs/heads/main') &&
16+
(github.event_name == 'pull_request_target' ||
17+
github.event.pull_request.head.repo.full_name != github.repository) }}
1518
runs-on: ubuntu-latest
1619
steps:
1720
- name: Checkout

.github/workflows/build-gitlab-container-PR.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ on:
88

99
jobs:
1010
pr-gitlab:
11-
if: ${{ github.repository != 'domjudge/domjudge-packaging' || github.ref != 'refs/heads/main' }}
11+
if: ${{ !(github.repository == 'domjudge/domjudge-packaging' &&
12+
github.ref == 'refs/heads/main') &&
13+
(github.event_name == 'pull_request_target' ||
14+
github.event.pull_request.head.repo.full_name != github.repository) }}
1215
name: PR GitLab image
1316
runs-on: ubuntu-latest
1417
permissions:

0 commit comments

Comments
 (0)