Skip to content

Conversation

@andyw8
Copy link
Contributor

@andyw8 andyw8 commented Feb 11, 2025

@andyw8 andyw8 force-pushed the andyw8/disable-schedule-jobs-for-forks branch from 64e7523 to ea79bd6 Compare February 12, 2025 00:25

jobs:
ruby-versions:
if: github.repository == 'ruby/irb'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Suggested change
if: github.repository == 'ruby/irb'
if: github.event_name == 'schedule' && github.repository != 'ruby/irb'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@andyw8 andyw8 force-pushed the andyw8/disable-schedule-jobs-for-forks branch from ea79bd6 to 26a66bd Compare February 13, 2025 02:27
@andyw8
Copy link
Contributor Author

andyw8 commented Feb 13, 2025

Updated with @tompng's feedback.

@tompng tompng merged commit 421c28f into ruby:master Feb 13, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants