Disable scheduled jobs for forks#1084
Conversation
64e7523 to
ea79bd6
Compare
|
|
||
| jobs: | ||
| ruby-versions: | ||
| if: github.repository == 'ruby/irb' |
There was a problem hiding this comment.
I have a use case where I want to check the CI results on my forked repository, so I’d like to disable only the scheduled job. How about this?
| if: github.repository == 'ruby/irb' | |
| if: github.event_name == 'schedule' && github.repository != 'ruby/irb' |
There was a problem hiding this comment.
if: github.repository == 'ruby/irb' || github.event_name != 'schedule'
Examples in other repositories in ruby org
https://github.com/search?q=org%3Aruby%20github.event_name%20%22%27schedule%27%22&type=code
I wish GitHub have a configuration of enabling/disabling scheduled jobs, not the whole workflow.
| - name: Run rubocop | ||
| run: bundle exec rubocop | ||
| irb: | ||
| if: github.repository == 'ruby/irb' |
There was a problem hiding this comment.
This if: (and if: in vterm-yamatanooroti job) is not needed because these jobs depend on ruby-versions.
Maybe lint and debug-test can have needs: ruby-versions so that we don't need to write many if: with the same condition. (I'd be happy if there is a better idea)
ea79bd6 to
26a66bd
Compare
|
Updated with @tompng's feedback. |
To prevent unwanted runs, e.g. https://github.com/andyw8/irb/actions/runs/13265307995