Skip to content

Commit 084ecae

Browse files
authored
Prevent GitHub Actions from unintentionally running on forks (#492)
Fixes #413.
1 parent eab4ae3 commit 084ecae

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.github/workflows/deploy-github-pages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ concurrency:
2424

2525
jobs:
2626
deploy-github-pages:
27+
# Only run this job on the original repository! To run this on your fork,
28+
# update or remove the line below.
29+
if: github.repository == 'code-chronicles-code/leetcode-curriculum'
30+
2731
environment:
2832
name: deploy-github-pages
2933
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/post-leetcode-potd-to-discord.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ concurrency:
2121

2222
jobs:
2323
post-leetcode-potd-to-discord:
24+
# Only run this job on the original repository! To run this on your fork,
25+
# update or remove the line below.
26+
if: github.repository == 'code-chronicles-code/leetcode-curriculum'
27+
2428
environment:
2529
name: post-leetcode-potd-to-discord
2630

.github/workflows/update-leetcode-problem-data.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ permissions:
2222

2323
jobs:
2424
update-problem-data:
25+
# Only run this job on the original repository! To run this on your fork,
26+
# update or remove the line below.
27+
if: github.repository == 'code-chronicles-code/leetcode-curriculum'
28+
2529
runs-on: ubuntu-latest
2630

2731
steps:

0 commit comments

Comments
 (0)