Add a manual trigger to the documentation workflow - #34
Open
hakonhagland wants to merge 1 commit into
Open
hakonhagland wants to merge 1 commit into
hakonhagland wants to merge 1 commit into
Conversation
The published documentation is rebuilt on a push here or on a repository_dispatch sent by opm-common or opm-simulators when their docstring files change. When such a dispatch fails there is no way to re-run the build short of sending the dispatch by hand through the API or pushing a commit. That happened after OPM/opm-simulators#7439 was merged: the dispatch was rejected with 401 "Bad credentials" because the token opm-simulators sends it with is no longer valid, and the documentation was only republished once the dispatch was sent manually with other credentials. OPM/opm-simulators#7443 makes that failure visible; this adds the way to recover from it. workflow_dispatch adds a "Run workflow" button to the Actions tab. The existing conditions already give it sensible behavior: run on master, github.ref is refs/heads/master and the gh-pages deploy step runs; run on any other branch it builds only, since the per-branch deploy step requires a push event. The branch list passed to sphinx-versioned falls back to github.ref_name, which is the selected branch.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed change is focused and has no unresolved issues.
Review effort: Lite
Findings: None
What changed in this PR
Adds a manual trigger to the Python documentation workflow so failed builds can be rerun from GitHub Actions.
Changes:
- Enables
workflow_dispatch. - Documents deployment behavior for master and other branches.
| File | Description |
|---|---|
.github/workflows/python_sphinx_docs.yml |
Adds the manual workflow trigger and usage guidance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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.
The workflow that builds and publishes the Python documentation can currently only be started by a
push, apull_request, or arepository_dispatchfrom opm-common or opm-simulators. When such a dispatch fails, there is no way to re-run the build from GitHub's web interface.That happened after OPM/opm-simulators#7439 was merged: the dispatch from opm-simulators was rejected with 401 "Bad credentials", because the token it is sent with is no longer valid, and the published API reference was only updated after the dispatch was sent by hand through the API with other credentials. OPM/opm-simulators#7443 makes that kind of failure show up as a red job; this PR adds a way to recover from it once noticed.
Add a
workflow_dispatchtrigger (commit 1)workflow_dispatch:to.github/workflows/python_sphinx_docs.yml, with a short comment saying what it is for. Once this is on master, the workflow gets a "Run workflow" button in the Actions tab.sphinx-versionedusesgithub.base_ref || github.ref_name. For a manual runbase_refis empty, so the selected branch is used, as forpushandrepository_dispatch.gh-pagesdeploy step runsif: github.ref == 'refs/heads/master', so a manual run on master rebuilds and republishes the site. This is the recovery case.github.event_name == 'push', so a manual run on any other branch only builds and publishes nothing.