Skip to content

Commit a7d371c

Browse files
Copilotpelikhan
andauthored
Skip agentics-maintenance jobs in forked repositories (#18532)
* Initial plan * Add fork guard if condition to all jobs in agentics-maintenance workflow Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent a32cb12 commit a7d371c

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/agentics-maintenance.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ permissions: {}
4242

4343
jobs:
4444
close-expired-entities:
45+
if: ${{ !github.event.repository.fork }}
4546
runs-on: ubuntu-slim
4647
permissions:
4748
discussions: write
@@ -88,6 +89,7 @@ jobs:
8889
await main();
8990
9091
compile-workflows:
92+
if: ${{ !github.event.repository.fork }}
9193
runs-on: ubuntu-slim
9294
permissions:
9395
contents: read
@@ -128,6 +130,7 @@ jobs:
128130
await main();
129131
130132
zizmor-scan:
133+
if: ${{ !github.event.repository.fork }}
131134
runs-on: ubuntu-slim
132135
needs: compile-workflows
133136
permissions:
@@ -151,6 +154,7 @@ jobs:
151154
echo "✓ Zizmor security scan completed"
152155
153156
secret-validation:
157+
if: ${{ !github.event.repository.fork }}
154158
runs-on: ubuntu-slim
155159
permissions:
156160
contents: read

pkg/workflow/maintenance_workflow.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ permissions: {}
140140
141141
jobs:
142142
close-expired-entities:
143+
if: ${{ !github.event.repository.fork }}
143144
runs-on: ubuntu-slim
144145
permissions:
145146
discussions: write
@@ -218,6 +219,7 @@ jobs:
218219
// Add compile-workflows job
219220
yaml.WriteString(`
220221
compile-workflows:
222+
if: ${{ !github.event.repository.fork }}
221223
runs-on: ubuntu-slim
222224
permissions:
223225
contents: read
@@ -263,6 +265,7 @@ jobs:
263265
await main();
264266
265267
zizmor-scan:
268+
if: ${{ !github.event.repository.fork }}
266269
runs-on: ubuntu-slim
267270
needs: compile-workflows
268271
permissions:
@@ -286,6 +289,7 @@ jobs:
286289
echo "✓ Zizmor security scan completed"
287290
288291
secret-validation:
292+
if: ${{ !github.event.repository.fork }}
289293
runs-on: ubuntu-slim
290294
permissions:
291295
contents: read

0 commit comments

Comments
 (0)