Skip to content

Prevent scheduled website workflows from running in forks#386

Merged
sapols merged 1 commit into
heliophysicsPy:mainfrom
sapols:codex/guard-scheduled-workflows
Jul 10, 2026
Merged

Prevent scheduled website workflows from running in forks#386
sapols merged 1 commit into
heliophysicsPy:mainfrom
sapols:codex/guard-scheduled-workflows

Conversation

@sapols

@sapols sapols commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Motivation

The PyHC website documents fork-and-pull as its contribution model, so contributors are expected to carry copies of these workflow files in their forks.

Someone reported receiving scheduled-workflow notifications from his website fork after GitHub Actions had been enabled there. Investigation showed two unintended fork-side effects:

  • The quarterly email reminder attempted to send the production PHEP 3 email without the upstream repository secrets and failed authentication.
  • The weekly schedule updater has repeatedly committed generated schedule changes directly to the fork's default branch, most recently in this run.

Forks should remain valid contribution workspaces without running the canonical repository's operational automation.

What changed

  • Guard the PHEP 3 Quarterly Email Reminder job with an exact canonical-repository check.
  • Apply the same guard to the Update PHEP 3 Schedule Weekly job.
  • Leave the pull-request test workflow unchanged.

Both guarded jobs now run only when:

github.repository == 'heliophysicsPy/heliophysicsPy.github.io'

If Actions or either workflow is enabled in a contributor fork, GitHub may still create the scheduled workflow run, but these jobs will skip before checking out code, accessing secrets, sending email, or committing generated files.

Validation

  • Both workflow files parse as valid YAML.
  • actionlint 1.7.12 passes with unrelated existing setup-python@v4 and shell-quoting diagnostics suppressed.
  • git diff --check passes.

@sapols sapols marked this pull request as ready for review July 10, 2026 17:56
@sapols sapols merged commit c907363 into heliophysicsPy:main Jul 10, 2026
1 check 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.

1 participant