Skip to content

Commit

Permalink
ci:prevent running pipelines on forks (microsoft#33584)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell authored Jan 9, 2025
1 parent 1eedd05 commit 95af8ed
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/azure-static-web-apps-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ permissions:

jobs:
build_and_deploy:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bundle-size-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:

jobs:
bundle-size-base:
if: ${{ github.repository_owner == 'microsoft' }}
# TODO: use macos-14-xlarge (arm) for faster builds once https://github.com/Azure/cli/issues/172 will be fixed
runs-on: ubuntu-latest
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bundle-size-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
permissions:
pull-requests: write
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:

jobs:
bundle-size:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: macos-14-xlarge
permissions:
contents: 'read'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/check-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
jobs:
dependency-deduplication:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -37,6 +38,7 @@ jobs:
dependency-mismatches:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -63,6 +65,7 @@ jobs:
change-files:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'microsoft' }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:

jobs:
check-tools:
if: ${{ github.repository_owner == 'microsoft' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:

jobs:
create-milestone:
if: ${{ github.repository_owner == 'microsoft' }}
name: Create this month's milestone
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docsite-publish-ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
check:
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'applying package updates') || github.event_name == 'workflow_dispatch' }}
if: ${{ github.repository_owner == 'microsoft' }} && ${{ contains(github.event.head_commit.message, 'applying package updates') || github.event_name == 'workflow_dispatch' }}

outputs:
status: ${{ steps.verify-react-components-changed.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:

jobs:
label:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
Expand All @@ -18,6 +19,7 @@ jobs:
configuration-path: .github/labeler.yml

assign-to-current-milestone:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: ubuntu-latest
steps:
- name: Assign to latest milestone
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-vrt-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
jobs:
run_vr_diff:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
outputs:
pr_number: ${{ steps.pr_number.outputs.result }}
permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-vrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ permissions:

jobs:
generate_vrt_screenshots:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: macos-14-xlarge
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-website-deploy-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.repository_owner == 'microsoft' }} && ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
outputs:
pr_number: ${{ steps.pr_number.outputs.result }}
website_url: ${{ steps.website_url.outputs.id }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:

jobs:
bundle:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: macos-14-xlarge
permissions:
contents: 'read'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:

jobs:
main:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on: macos-14-xlarge
permissions:
contents: 'read'
Expand Down Expand Up @@ -81,6 +82,7 @@ jobs:
git diff-index --quiet HEAD -- || exit 1
e2e:
if: ${{ github.repository_owner == 'microsoft' }}
# TODO: switch to macos once problematic tests are fixed
# https://github.com/microsoft/fluentui/issues/33173
# https://github.com/microsoft/fluentui/issues/33172
Expand Down

0 comments on commit 95af8ed

Please sign in to comment.