Make documentation workflow fork-friendly with dynamic branch detection#19
Make documentation workflow fork-friendly with dynamic branch detection#19hakonhagland wants to merge 1 commit intoOPM:masterfrom
Conversation
This commit makes the Sphinx documentation build workflow work seamlessly on forks that may not have all release branches available. Changes: 1. Added python/scripts/get_doc_branches.sh script that dynamically detects available branches (current, master, release-*) in the repository 2. Updated python_sphinx_docs.yml to use the script instead of hardcoded branch lists, removing the need for manual edits when testing on forks 3. Clarified comment to distinguish between manual release branch creation and automatic branch detection Benefits: - Workflow automatically adapts to available branches in any fork - No manual edits needed for testing in development forks - Gracefully handles missing release branches - Automatically includes new release branches as they're added The script checks for remote branches to ensure it works properly with both the main repository (which has all branches) and forks (which may only have a subset).
|
this is not clear to. Are we really building for all release branches? Shouldn't changes only affect the master and this would be overkill? When is this triggered? |
@blattms Current behavior (on master): Yes, the workflow already builds for all listed release branches.
The PR behavior is the same - builds for all available release branches, but now detected dynamically instead of hardcoded. This enables a contributor to build the documentation locally on his fork (where The sphinx-versioned tool generates multi-version documentation with a version switcher dropdown, so building all versions is intentional for the documentation site.
On every push to any branch, not just master, see |
This commit makes the Sphinx documentation build workflow work seamlessly on forks that may not have all release branches available.
Changes:
Added
python/scripts/get_doc_branches.shscript that dynamically detects available branches (current, master, release-*) in the repositoryUpdated
python_sphinx_docs.ymlto use the script instead of hardcoded branch lists, removing the need for manual edits when testing on forksClarified comment to distinguish between manual release branch creation and automatic branch detection
Benefits:
The script checks for remote branches to ensure it works properly with both the main repository (which has all branches) and forks (which may only have a subset).