Skip to content

Prevent fork deployments and publish documentation only from develop - #550

Merged
dav-sonn merged 2 commits into
mainfrom
website-workflow-guards-main
Oct 27, 2026
Merged

dav-sonn merged 2 commits into
mainfrom
website-workflow-guards-main

Conversation

@hk-2029

@hk-2029 hk-2029 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Fork syncs currently attempt GitHub Pages deployment and fail when the fork has no Pages configuration. The older workflow on main also still targets main for publication.

This aligns main with the fix on develop (582acba). Only simpaths/SimPaths on develop can publish. Documentation validation remains available for main/develop pushes and pull requests, while expensive build steps run only when website, API or build inputs change. Unrelated changes still receive a successful check job; manual runs force a build.

Change detection uses complete Git diffs, including deletions, renames and multi-commit syncs, and builds conservatively if history is unavailable. Deployments use queue: max so an older build finishing late cannot cancel a newer pending deployment. The freshness check then prevents outdated website/API content from being published. GitHub limits this queue to 100 pending jobs; publication can be retried manually if that limit is reached. Only deployments enter the queue, so unrelated pushes cannot displace them.

The same five workflow/helper files are used on both branches. No website content or model code changes are included. The Pages environment already permits only develop.

Validation:

  • All 11 Git-history tests pass on both branches. Repository/branch guards and file parity checked.
  • A local model of GitHub's documented queue semantics reproduces the reported loss with the old policy and retains the newest deployment for all six completion orders of three builds with the fix.
  • Actionlint 1.7.12 passes with only its known unsupported concurrency.queue diagnostic excluded; the setting is documented by GitHub and present in the current workflow schema.
  • The corrected develop revision (582acba) passed GitHub documentation checks and deployed successfully, including the strict website/Javadoc build and publication browser checks. All six PR checks pass at 19385b0, including documentation, build, integration and simulation checks.

References: GitHub concurrency rules, actionlint limitation.

@dav-sonn
dav-sonn requested review from dav-sonn and a balanced review from Copilot October 27, 2026 16:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An older build can displace the newest pending deployment and then reject itself as stale, leaving current documentation unpublished.

1 open issue
What changed in this PR

This PR restricts SimPaths documentation publication to the upstream repository’s develop branch while preserving documentation validation on main, develop, and pull requests.

Changes:

  • Add repository and branch guards to prevent fork and main deployments.
  • Gate expensive documentation checks on complete Git diffs, with conservative fallbacks and forced manual builds.
  • Add change-detection tests and workflow documentation, and move Pages concurrency to deployment jobs.
File Description
.github/​workflows/​docs-checks.yml Gate expensive validation while keeping the check job present.
.github/​workflows/​deploy-docs.yml Restrict publication and add deployment freshness checks.
.github/​scripts/​test_docs_changes.py Test input selection and Git-history edge cases.
.github/​scripts/​README.md Document build triggers and publication behavior.
.github/​scripts/​docs_changes.py Detect relevant changes from event-specific Git diffs.

Review effort: Balanced

Comment thread .github/workflows/deploy-docs.yml Resolved
@dav-sonn
dav-sonn merged commit adf2402 into main Oct 27, 2026
6 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.

3 participants