Skip to content

ci: keep scheduled workflows from running on forks - #823

Merged
frahlg merged 4 commits into
srcfl:masterfrom
HuggeK:fork-schedule-guards
Aug 7, 2026
Merged

ci: keep scheduled workflows from running on forks#823
frahlg merged 4 commits into
srcfl:masterfrom
HuggeK:fork-schedule-guards

Conversation

@HuggeK

@HuggeK HuggeK commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Forks inherit .github/workflows/ the moment they sync master, and both scheduled workflows misfire when a fork runs them unattended:

  • bundled driver pin (daily) opens its tracking issue in whatever repository it runs in. On a fork the pin is genuinely behind, the issue belongs upstream, and a fork with issues disabled can't even file it — so the run fails, and the fork's owner gets a failure email every morning.
  • rpi installer image (monthly) runs the full pi-gen build and publishes an installer release on the fork — an hour of the fork owner's runner time to ship an artifact nobody asked for.

This gates only the schedule event to srcfl/ftw. Manual dispatches and pushes are somebody deliberately asking, so they still run everywhere — including on forks.

Observed on a real fork

HuggeK/ftw (issues disabled, Actions enabled) failed bundled driver pin on both of the last two mornings — e.g. this run, which correctly detects the pin is behind and then dies on the 'HuggeK/ftw' repository has disabled issues. The same fork's monthly schedule also built and published an installer release to its own rpi-installer tag on August 1st.

The new debian base currency workflow proposed in #733 has the same shape; the matching guard is being added on that branch rather than here, since that file only exists there.

CI-only change, so it rides the changeset auto-exemption.

🤖 Generated with Claude Code

Co-authored-by: HuggeK <48095810+HuggeK@users.noreply.github.com>
@HuggeK
HuggeK marked this pull request as ready for review August 5, 2026 09:47
@HuggeK
HuggeK requested a review from frahlg as a code owner August 5, 2026 09:47

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Guards two scheduled workflows (bundled-driver-pin, rpi-image-build) so they only fire on srcfl/ftw for schedule events — a fork that syncs master no longer inherits an hourly/monthly job that fails or burns runner time for its owner. Manual dispatch and pushes still run everywhere, which is the right scope for "deliberate" vs "inherited."

  • Correctness: the if: conditions read right — github.repository == 'srcfl/ftw' || github.event_name != 'schedule' lets non-schedule events through unconditionally on any repo, and gates only the schedule case to the upstream repo. Matches the stated intent exactly.
  • Security: no secrets, no new permissions, no new external calls — pure workflow-trigger scoping.
  • All checks green.

Safe to merge from my read.

frahlg commented Aug 7, 2026

Copy link
Copy Markdown
Member

Current merge review:

  • Read the existing review and the full diff.
  • The guards only block inherited schedule runs on forks; push and manual dispatch still work there.
  • No secrets, permissions, or external calls change.
  • No other open PR changes either workflow file.
  • .github/ requires a CODEOWNER review. The existing review is COMMENTED, so I will add an owner approval only after fresh checks pass.

The branch is behind master. Updating it now, then rechecking the exact head, CI, reviews, and threads before merge.

@frahlg frahlg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CODEOWNER review complete on the current head. The two guards scope only inherited schedule runs on forks, keep deliberate push and manual runs, and add no permissions or external calls. The branch is current, the diff has no open-PR overlap, and fresh checks pass.

@frahlg
frahlg merged commit 6c50c8c into srcfl:master Aug 7, 2026
15 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.

4 participants