Skip to content

Commit e01c2e3

Browse files
authored
Merge pull request #83 from stratika/fix/cicd-on-upstream
[cicd] Prevent workflows from running on forks
2 parents 09622dd + db47a2b commit e01c2e3

5 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/build-and-run.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616

1717
jobs:
1818
code-quality:
19+
if: github.repository == 'beehive-lab/GPULlama3.java'
1920
runs-on: self-hosted
2021
timeout-minutes: 30
2122

@@ -29,6 +30,7 @@ jobs:
2930
# ./mvnw -T12C -Pspotless spotless:check
3031
3132
build-and-run:
33+
if: github.repository == 'beehive-lab/GPULlama3.java'
3234
runs-on: [self-hosted]
3335
needs: code-quality
3436
timeout-minutes: 30

.github/workflows/deploy-maven-central.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
jobs:
2525
deploy:
2626
name: Deploy to Maven Central
27+
if: github.repository == 'beehive-lab/GPULlama3.java'
2728
runs-on: [self-hosted, Linux, x64]
2829
timeout-minutes: 15
2930
env:

.github/workflows/finalize-release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ jobs:
1515
create-release-tag:
1616
# Run when release PR merges OR manual trigger
1717
if: |
18-
(github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')) ||
19-
github.event_name == 'workflow_dispatch'
18+
github.repository == 'beehive-lab/GPULlama3.java' &&
19+
((github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')) ||
20+
github.event_name == 'workflow_dispatch')
2021
runs-on: [self-hosted, Linux, x64]
2122
permissions:
2223
contents: write
@@ -131,7 +132,7 @@ jobs:
131132
runs-on: [self-hosted, Linux, x64]
132133
permissions:
133134
contents: write
134-
if: github.event_name == 'pull_request'
135+
if: github.repository == 'beehive-lab/GPULlama3.java' && github.event_name == 'pull_request'
135136

136137
steps:
137138
- name: Delete release branch

.github/workflows/prepare-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ env:
2323

2424
jobs:
2525
prepare-release:
26+
if: github.repository == 'beehive-lab/GPULlama3.java'
2627
runs-on: [self-hosted, Linux, x64]
2728
permissions:
2829
contents: write

.github/workflows/rerun-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
name: Rerun CI Workflows
1010
# Only run on PR comments (not issue comments) with /rerun command
1111
if: |
12+
github.repository == 'beehive-lab/GPULlama3.java' &&
1213
github.event.issue.pull_request &&
1314
contains(github.event.comment.body, '/rerun')
1415
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)