-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't run scheduled jobs on forks #584
Don't run scheduled jobs on forks #584
Conversation
Well this doesn't seem to work. I'll try something else. |
Codecov Report
@@ Coverage Diff @@
## master #584 +/- ##
==========================================
- Coverage 39.90% 38.96% -0.94%
==========================================
Files 2 2
Lines 213 213
Branches 39 39
==========================================
- Hits 85 83 -2
- Misses 128 130 +2
Continue to review full report at Codecov.
|
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
It works now. |
Is there any way that we can reduce the duplication? |
I'll try |
It's not valid apparently: defaults:
# Don't run scheduled jobs on forks
if: ${{ (github.event_name != 'schedule') || (github.event_name == 'schedule' && github.repository == 'ros-tooling/action-ros-ci') }}
I can think of two alternatives, but they all require some level of duplication and are a bit more complex, so I'm not sure if it's worth it:
I'll try option 2. Note that YAML anchors are unfortunately not supported: https://github.community/t/support-for-yaml-anchors/16128/61 |
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
Option 2 works nicely: https://github.com/christophebedard/action-ros-ci/actions/runs/662189751 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for figuring out this way to do it - it looks pretty clean to me
Noting that the reason this didn't work is because the |
I often enable actions on my fork to open PRs (on my own fork) to test things out with CI. There's no real reason to run hourly scheduled jobs on forks.
I tried these and they didn't work:
if: ${{ (github.event_name != 'schedule') || (github.event_name == 'schedule' && !github.event.repository.fork) }}
if: ${{ (github.event_name != 'schedule') || (github.event_name == 'schedule' && github.event.repository.fork == false) }}