Skip to content

Commit f4983fa

Browse files
authored
Skip preview jobs on fork repositories (#763)
* Skip preview jobs on fork repositories * Add explaining comment
1 parent d05612c commit f4983fa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/preview-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ permissions:
4545

4646
jobs:
4747
build:
48+
if: github.event.repository.fork == false # Skip running the job on the fork itself (It still runs on PRs on the upstream from forks)
4849
concurrency:
4950
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }}
5051
cancel-in-progress: ${{ startsWith(github.event_name, 'pull_request') }}

.github/workflows/preview-cleanup.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212

1313
jobs:
1414
destroy:
15+
if: github.event.repository.fork == false # Skip running the job on the fork itself (It still runs on PRs on the upstream from forks)
1516
runs-on: ubuntu-latest
1617
steps:
1718
- name: Delete GitHub environment
@@ -53,4 +54,4 @@ jobs:
5354
aws s3 rm "s3://elastic-docs-v3-website-preview/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}" --recursive
5455
5556
- name: 'Update Reference Index'
56-
uses: elastic/docs-builder/actions/update-reference-index@main
57+
uses: elastic/docs-builder/actions/update-reference-index@main

0 commit comments

Comments
 (0)