Run scheduled CI jobs only on upstream repo#6157
Conversation
.github/workflows/release.yml
Outdated
| build: | ||
| runs-on: ${{ matrix.platform.runner }} | ||
| # Disable this job when running on a fork. | ||
| if: github.repository == 'RustPython/RustPython' |
There was a problem hiding this comment.
Though I don't know well about actions. What if we need to edit release.yml? Then isn't it better to run it on the fork?
There was a problem hiding this comment.
Though I don't know well about actions. What if we need to edit release.yml? Then isn't it better to run it on the fork?
Not sure I understand your concern. this only prevents this job from triggering on RustPython forks, like mine:
https://github.com/ShaharNaveh/RustPython/actions/workflows/release.yml
I see that you disabled it manually for yourself lol:
https://github.com/youknowone/RustPython/actions/workflows/cron-ci.yaml
There was a problem hiding this comment.
I think that I get what you mean, we can have something like:
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}this way it will always run on the upstream repo and can still be triggered with workflow_dispatch on forks
There was a problem hiding this comment.
Oh, I can't remember why I did it. Probably cron-ci was broken once a while ago. And never be fixed and forgotten.
The event_name check makes sense. Thanks!
There's no point in running those tasks on forks anyway imo.
I wish Github Actions allowed top level
if:/https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax