Skip to content

Commit 02e09e3

Browse files
authored
MNT Do not run doc building on a fork (#23517)
1 parent fb3ed90 commit 02e09e3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/build-docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
jobs:
1616
# Build the documentation against the minimum version of the dependencies
1717
doc-min-dependencies:
18+
# This prevents this workflow from running on a fork.
19+
# To test this workflow on a fork, uncomment the following line.
20+
if: github.repository == 'scikit-learn/scikit-learn'
21+
1822
runs-on: ubuntu-latest
1923
steps:
2024
- name: Checkout scikit-learn
@@ -41,6 +45,10 @@ jobs:
4145

4246
# Build the documentation against the latest version of the dependencies
4347
doc:
48+
# This prevents this workflow from running on a fork.
49+
# To test this workflow on a fork, uncomment the following line.
50+
if: github.repository == 'scikit-learn/scikit-learn'
51+
4452
runs-on: ubuntu-latest
4553
steps:
4654
- name: Checkout scikit-learn

.github/workflows/trigger-hosting.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ jobs:
1111
push:
1212
runs-on: ubuntu-latest
1313
# Run the job only if the "Documentation builder" workflow succeeded
14-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
# Prevents this workflow from running on a fork.
15+
# To test this workflow on a fork remove the `github.repository == scikit-learn/scikit-learn` condition
16+
if: github.repository == 'scikit-learn/scikit-learn' && github.event.workflow_run.conclusion == 'success'
1517
steps:
1618
- name: Checkout scikit-learn
1719
uses: actions/checkout@v2

0 commit comments

Comments
 (0)