Skip to content

Conversation

@ShaharNaveh
Copy link
Collaborator

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

build:
runs-on: ${{ matrix.platform.runner }}
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Collaborator Author

@ShaharNaveh ShaharNaveh Sep 20, 2025

Choose a reason for hiding this comment

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

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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!

@youknowone youknowone merged commit 24f4fba into RustPython:main Sep 20, 2025
11 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.

2 participants