CI Scheduled fork upstream ensurance#1879
Merged
Merged
Conversation
chore: prevent forks to run cronjobbed sync commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Forks of this repository inherit the same GitHub Actions workflows, including the hourly cron schedule on
sync-models.yml. Every hour, each fork (currently 1k forks available) spins up runners and attempts to run the full model sync pipeline: A massive and unnecessary waste of CI resources, with missing CI secrets. It currently generates a ton of failing pipelines for every fork.Every person who forked the repository will start to get hourly failing CI notification and mail as well, due to missing repository secrets.
People could go into their fork's Settings → Actions and disable them, but nobody does.
Changes
Added
if: github.repository == 'anomalyco/models.dev'to:.github/workflows/sync-models.yml— bothprovidersandsyncjobs (scheduled cron, the main offender).github/workflows/deploy.yml— thedeployjob (push-triggered, but also runs on rebases/force-pushes todevin forks, wasting runners)This ensures these workflows only execute on the upstream repository.
Reasoning