CI: Prevent cron job workflow runs on forks by nkphysics · Pull Request #3468 · astropy/astroquery · GitHub
Skip to content

CI: Prevent cron job workflow runs on forks - #3468

Open
nkphysics wants to merge 4 commits into
astropy:mainfrom
nkphysics:disable-cron-on-forks
Open

nkphysics wants to merge 4 commits into
astropy:mainfrom
nkphysics:disable-cron-on-forks

Conversation

@nkphysics

Copy link
Copy Markdown
Member

This PR implements conditions to CI actions to prevent scheduled cron job actions from running on forks to resolve #3457

Changes

  • Added explicit fork-protection to all scheduled CI workflows using the pattern already in use across the open source python ecosystem:
    if: github.repository == 'astropy/astroquery' || github.event_name != 'schedule'
    

This allows normal push, pull_request, tag, and manual triggers to continue working on forks (still useful for testing PRs), while completely skipping scheduled runs on any fork. I also left a comment in the workflows for anyone that wants to enable the workflows on their forks.

I applied this to the following workflows:

  • .github/workflows/ci_crontests.yml

  • .github/workflows/ci_devtest.yml

  • .github/workflows/ci_tests.yml (both the tests and egg_info jobs)

  • .github/workflows/ci-online-crontests.yml left it alone as it already uses github.repository == 'astropy/astroquery' condition.

Also, I know that this was not covered in the issue ticket, but I also applied a condition to the codeql workflow since I looked at my fork and it was running on a schedule there too.

I restricted to the upstream repository only using the stricter condition if: github.repository == 'astropy/astroquery' since the results from forks are ignored by GitHub anyway, so its kinda just a waste.

Screenshot from 2025-11-28 00-31-09

I'm not sure if this requires a changelog entry. I tried looking at some closed infra/CI PRs and many were marked with a "no-changelog-needed" tag, so I won't include one for now, but can add one if its needed.

Also can make similar changes to astropy/pyvo#705 if that would be helpful @bsipocz.

Hope this is a helpful ! 😄

@codecov

codecov Bot commented Nov 28, 2025 •

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: make sure cron jobs are not running on forks

3 participants