Make the documentation dispatch job fail when GitHub rejects the request - #7443
Merged
Merged
Conversation
The dispatch step posts to the GitHub API with a bare curl. curl exits 0 for any HTTP response, including an error, so when the request is rejected the step prints the error body and the job still reports success. That is what happened after OPM#7439 was merged: the job was green, but its log shows "message": "Bad credentials", "status": "401" and no documentation build was triggered. Because the job stayed green, nothing indicated that the published Python API reference had not been updated. With --fail-with-body, curl still prints the response body, so the log keeps the reason, but exits with status 22 on an HTTP error, which fails the step. A successful dispatch returns 204 and is unaffected.
The step was labeled "Send dispatch to opm-simulators", but it runs in opm-simulators and sends the dispatch to opm-python-documentation. The label is what the Actions UI shows for the step, so when the dispatch fails, the log points at the wrong repository.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The narrowly scoped workflow changes address the silent failure without introducing unresolved issues.
Review effort: Lite
Findings: None
What changed in this PR
Updates the documentation dispatch workflow to surface rejected GitHub API requests and clarify the target repository.
Changes:
- Adds
curl --fail-with-bodyto fail on HTTP errors while retaining response details. - Renames the dispatch step to identify
opm-python-documentation.
| File | Summary |
|---|---|
.github/workflows/dispatch_opm_simulators.yml |
Improves dispatch failure detection and step labeling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
blattms
approved these changes
Sep 25, 2026
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 job in
.github/workflows/dispatch_opm_simulators.yml, which tells opm-python-documentation to rebuild the Python API reference afterpython/docstrings_simulators.jsonchanges, reports success even when the dispatch is rejected. After #7439 was merged the job was green, but its log shows:{ "message": "Bad credentials", "documentation_url": "https://docs.github.com/rest", "status": "401" }No documentation build was triggered, and nothing in the Actions UI said so. The published reference was only updated after the dispatch was sent by hand.
This PR does not fix the credentials — the
PERSONAL_ACCESS_TOKENsecret needs renewing by someone with admin rights here. It makes the next failure of this kind visible instead of silent.Fail the dispatch job when GitHub rejects the request (commit 1)
curl -X POST.curlexits 0 for any HTTP response, including 401, so the step's shell sees success and the job passes.--fail-with-body: on an HTTP status of 400 or abovecurlnow exits with status 22, which fails the step, while still printing the response body, so the log keeps the reason. Plain--failwould discard the body and leave only the status code.Name the dispatch step after the repository it notifies (commit 2)
Verification
bash -e -o pipefailas a GitHub Actionsrun:step uses. The current command printed the sameBad credentialsbody as the CI log and exited 0; with--fail-with-bodyit printed the same body and exited 22.curl's documented behavior of failing only on status 400 or above.--fail-with-bodyneeds curl 7.76 or newer; the runner image is Ubuntu 24.04, which ships curl 8.5.The first real test will be the next merge that touches
python/docstrings_simulators.json: with the secret still invalid that job will now be red, and once the secret is renewed it should be green with a documentation build following it.🤖 Generated with Claude Code