Skip to content

Commit 95af8ed

Browse files
authored
ci:prevent running pipelines on forks (#33584)
1 parent 1eedd05 commit 95af8ed

14 files changed

+18
-4
lines changed

.github/workflows/azure-static-web-apps-deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313

1414
jobs:
1515
build_and_deploy:
16+
if: ${{ github.repository_owner == 'microsoft' }}
1617
runs-on: ubuntu-latest
1718
name: Build and Deploy Job
1819
steps:

.github/workflows/bundle-size-base.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818

1919
jobs:
2020
bundle-size-base:
21+
if: ${{ github.repository_owner == 'microsoft' }}
2122
# TODO: use macos-14-xlarge (arm) for faster builds once https://github.com/Azure/cli/issues/172 will be fixed
2223
runs-on: ubuntu-latest
2324
permissions:

.github/workflows/bundle-size-comment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
comment:
1010
runs-on: ubuntu-latest
11-
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
11+
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
1212
permissions:
1313
pull-requests: write
1414
steps:

.github/workflows/bundle-size.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616

1717
jobs:
1818
bundle-size:
19+
if: ${{ github.repository_owner == 'microsoft' }}
1920
runs-on: macos-14-xlarge
2021
permissions:
2122
contents: 'read'

.github/workflows/check-packages.yml

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
jobs:
66
dependency-deduplication:
77
runs-on: ubuntu-latest
8+
if: ${{ github.repository_owner == 'microsoft' }}
89
steps:
910
- uses: actions/checkout@v4
1011
with:
@@ -37,6 +38,7 @@ jobs:
3738
3839
dependency-mismatches:
3940
runs-on: ubuntu-latest
41+
if: ${{ github.repository_owner == 'microsoft' }}
4042
steps:
4143
- uses: actions/checkout@v4
4244
with:
@@ -63,6 +65,7 @@ jobs:
6365
6466
change-files:
6567
runs-on: ubuntu-latest
68+
if: ${{ github.repository_owner == 'microsoft' }}
6669
steps:
6770
- uses: actions/checkout@v4
6871
with:

.github/workflows/check-tooling.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414

1515
jobs:
1616
check-tools:
17+
if: ${{ github.repository_owner == 'microsoft' }}
1718
strategy:
1819
matrix:
1920
os: [ubuntu-latest, windows-latest]

.github/workflows/create-milestone.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010

1111
jobs:
1212
create-milestone:
13+
if: ${{ github.repository_owner == 'microsoft' }}
1314
name: Create this month's milestone
1415
runs-on: ubuntu-latest
1516
steps:

.github/workflows/docsite-publish-ghpages.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
check:
1212
runs-on: ubuntu-latest
13-
if: ${{ contains(github.event.head_commit.message, 'applying package updates') || github.event_name == 'workflow_dispatch' }}
13+
if: ${{ github.repository_owner == 'microsoft' }} && ${{ contains(github.event.head_commit.message, 'applying package updates') || github.event_name == 'workflow_dispatch' }}
1414

1515
outputs:
1616
status: ${{ steps.verify-react-components-changed.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' }}

.github/workflows/pr-housekeeping.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ permissions:
99

1010
jobs:
1111
label:
12+
if: ${{ github.repository_owner == 'microsoft' }}
1213
runs-on: ubuntu-latest
1314
steps:
1415
- uses: actions/labeler@v5
@@ -18,6 +19,7 @@ jobs:
1819
configuration-path: .github/labeler.yml
1920

2021
assign-to-current-milestone:
22+
if: ${{ github.repository_owner == 'microsoft' }}
2123
runs-on: ubuntu-latest
2224
steps:
2325
- name: Assign to latest milestone

.github/workflows/pr-vrt-comment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
jobs:
1919
run_vr_diff:
2020
runs-on: ubuntu-latest
21-
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
21+
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
2222
outputs:
2323
pr_number: ${{ steps.pr_number.outputs.result }}
2424
permissions:

.github/workflows/pr-vrt.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ permissions:
1818

1919
jobs:
2020
generate_vrt_screenshots:
21+
if: ${{ github.repository_owner == 'microsoft' }}
2122
runs-on: macos-14-xlarge
2223
steps:
2324
- uses: actions/checkout@v4

.github/workflows/pr-website-deploy-comment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
deploy:
1919
runs-on: ubuntu-latest
20-
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
20+
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
2121
outputs:
2222
pr_number: ${{ steps.pr_number.outputs.result }}
2323
website_url: ${{ steps.website_url.outputs.id }}

.github/workflows/pr-website-deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616

1717
jobs:
1818
bundle:
19+
if: ${{ github.repository_owner == 'microsoft' }}
1920
runs-on: macos-14-xlarge
2021
permissions:
2122
contents: 'read'

.github/workflows/pr.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ env:
2323

2424
jobs:
2525
main:
26+
if: ${{ github.repository_owner == 'microsoft' }}
2627
runs-on: macos-14-xlarge
2728
permissions:
2829
contents: 'read'
@@ -81,6 +82,7 @@ jobs:
8182
git diff-index --quiet HEAD -- || exit 1
8283
8384
e2e:
85+
if: ${{ github.repository_owner == 'microsoft' }}
8486
# TODO: switch to macos once problematic tests are fixed
8587
# https://github.com/microsoft/fluentui/issues/33173
8688
# https://github.com/microsoft/fluentui/issues/33172

0 commit comments

Comments
 (0)