code-chronicles-code / leetcode-curriculum

https://code-chronicles-code.github.io/leetcode-curriculum/
MIT License
6 stars 12 forks source link

Prevent github actions from running unintentionally on forks #413

Open Gobleizer opened 1 week ago

Gobleizer commented 1 week ago

Some github workflows require secrets that do not travel with forks. Some github workflows do not make sense to be run against forks, such as github pages updates.

Prevent these workflows from accidently being run by adding conditionals to the workflows as referenced below: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-only-run-job-for-specific-repository This currently applies to the following workflows: https://github.com/code-chronicles-code/leetcode-curriculum/blob/main/.github/workflows/post-leetcode-potd-to-discord.yml https://github.com/code-chronicles-code/leetcode-curriculum/blob/main/.github/workflows/deploy-github-pages.yml https://github.com/code-chronicles-code/leetcode-curriculum/blob/main/.github/workflows/update-leetcode-problem-data.yml

Gobleizer commented 1 week ago

I guess I don't have the ability to assign myself, but I am on this one :)

miorel commented 1 week ago

Thank you @Gobleizer!