Skip to content

Commit 11f293f

Browse files
authored
chore: restrict workflows to main repo (PaloAltoNetworks#1169)
1 parent 5fb1191 commit 11f293f

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

.github/workflows/build-perf.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
jobs:
1111
build-size:
12+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
1213
name: Build Size Report
1314
timeout-minutes: 30
1415
runs-on: ubuntu-latest
@@ -29,6 +30,7 @@ jobs:
2930
compression: none
3031

3132
build-time:
33+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
3234
name: Build Time Perf
3335
timeout-minutes: 30
3436
runs-on: ubuntu-latest

.github/workflows/deploy-live.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
build:
9-
if: github.repository_owner == 'PaloAltoNetworks'
9+
if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs'
1010
name: Build
1111
runs-on: ubuntu-latest
1212

@@ -35,6 +35,7 @@ jobs:
3535
path: build.zip
3636

3737
deploy:
38+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
3839
name: Deploy
3940
needs: build
4041
runs-on: ubuntu-latest

.github/workflows/deploy-preview.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
precheck:
9+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
910
name: Precheck
1011
runs-on: ubuntu-latest
1112
permissions:
@@ -21,7 +22,7 @@ jobs:
2122
GH_TOKEN: ${{ secrets.PAT }}
2223

2324
analyze:
24-
if: github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result == 'null'
25+
if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && needs.precheck.outputs.is-org-member-result == 'null'
2526
name: Analyze
2627
needs: precheck
2728
runs-on: ubuntu-latest
@@ -49,7 +50,7 @@ jobs:
4950
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3
5051

5152
analyze_unsafe:
52-
if: github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result != 'null'
53+
if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && needs.precheck.outputs.is-org-member-result != 'null'
5354
name: Analyze Unsafe
5455
needs: precheck
5556
runs-on: ubuntu-latest
@@ -81,7 +82,8 @@ jobs:
8182
name: Build
8283
needs: [analyze, analyze_unsafe]
8384
if: |
84-
!failure() && !cancelled() &&
85+
github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' &&
86+
!failure() && !cancelled() &&
8587
(success('analyze') || success('analyze_unsafe'))
8688
runs-on: ubuntu-latest
8789
permissions:
@@ -116,7 +118,7 @@ jobs:
116118
deploy:
117119
name: Deploy
118120
needs: build
119-
if: ${{ !failure() && !cancelled() }}
121+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && !failure() && !cancelled() }}
120122
runs-on: ubuntu-latest
121123

122124
steps:

.github/workflows/pr-title-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414

1515
jobs:
1616
check:
17+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
1718
name: Check
1819
runs-on: ubuntu-latest
1920
steps:

.github/workflows/validate.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111

1212
jobs:
1313
prepare-yarn-cache:
14+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
1415
name: Prepare Cache
1516
runs-on: ubuntu-latest
1617
steps:
@@ -29,6 +30,7 @@ jobs:
2930
run: yarn install --frozen-lockfile
3031

3132
lint:
33+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
3234
name: Lint
3335
needs: prepare-yarn-cache
3436
runs-on: ubuntu-latest
@@ -51,6 +53,7 @@ jobs:
5153
run: yarn lint --max-warnings 0
5254

5355
test:
56+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
5457
name: Test
5558
needs: prepare-yarn-cache
5659
runs-on: ubuntu-latest
@@ -71,6 +74,7 @@ jobs:
7174
run: yarn test
7275

7376
cypress:
77+
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
7478
name: Cypress
7579
needs: prepare-yarn-cache
7680
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)