Skip to content

Conversation

@nkphysics
Copy link
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
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.48%. Comparing base (3418e41) to head (0723c36).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3468   +/-   ##
=======================================
  Coverage   71.48%   71.48%           
=======================================
  Files         234      234           
  Lines       20096    20096           
=======================================
  Hits        14365    14365           
  Misses       5731     5731           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

2 participants