Skip to content

feat: Report dispatch failures with their HTTP status and request - #117

Open
whisperity wants to merge 1 commit into
benc-uk:mainfrom
whisperity:fix/issue-116
Open

whisperity wants to merge 1 commit into
benc-uk:mainfrom
whisperity:fix/issue-116

Conversation

@whisperity

Copy link
Copy Markdown

When GitHub answers the dispatch request with an error that has an empty body, Octokit builds an error with an empty message. core.setFailed("") then writes an ::error:: command without text, which the runner discards. The step failed with nothing in its log after "Calling GitHub API to dispatch workflow…".

Every failure is now reported with a non-empty text, naming the HTTP status, the request, and what the response body said, or that it was empty. Network failures without a response are named as such, and the error handler was fixed to ensure that non-Error objects are also handled appropriately.
Long response bodies, such as HTML error pages, are collapsed to a single line and cut.

A failure of the dispatch request itself names the workflow, the repository and the ref. After a server or network error it also warns that GitHub may still have created the run, so that the workflow's run history is checked before dispatching again.

Fixes #116.

When GitHub answers the dispatch request with an error that has an
empty body, Octokit builds an error with an empty message.
`core.setFailed("")` then writes an `::error::` command without text,
which the runner discards. The step failed with nothing in its log
after "Calling GitHub API to dispatch workflow…".

Every failure is now reported with a non-empty text, naming the HTTP
status, the request, and what the response body said, or that it was
empty. Network failures without a response are named as such, and
the error handler was fixed to ensure that non-`Error` objects are
also handled appropriately.
Long response bodies, such as HTML error pages, are collapsed to a
single line and cut.

A failure of the dispatch request itself names the workflow, the
repository and the ref. After a server or network error it also warns
that GitHub may still have created the run, so that the workflow's run
history is checked before dispatching again.

This branch has not been deployed

No deployments
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.

Action failures should always loudly log an error instead of silently not dispatching

1 participant