Print body on error to aid in debugging #10

Closed
opened 2026-03-29 17:50:04 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @chandlerc on GitHub (Apr 15, 2021).

It would be really nice to print out the body of the webhook when it fails.

Even better would be to print out a curl command line to reproduce the failure, with any secrets un-substituted. Unclear if this is implementable though.

That said, just redacting the URL and making printing out the body (and header) on failure an opt-in feature that folks who don't have secrets in their body or header can opt into would be awesome. Formatting it as a curl commandline (but with the user having to provide a URL) would still be really helpful.

I know its possible to simulate this, but the best way I've found is pretty convoluted: add the body to the job's environment and add steps to print that environment prior to the webhook attempting to pass it as the body. It'd be much cleaner and nicer to have the webhook JS code do this error logging for us.

Originally created by @chandlerc on GitHub (Apr 15, 2021). It would be really nice to print out the body of the webhook when it fails. Even better would be to print out a `curl` command line to reproduce the failure, with any secrets un-substituted. Unclear if this is implementable though. That said, just redacting the URL and making printing out the body (and header) on failure an opt-in feature that folks who don't have secrets in their body or header can opt into would be awesome. Formatting it as a `curl` commandline (but with the user having to provide a URL) would still be really helpful. I know its possible to simulate this, but the best way I've found is pretty convoluted: add the body to the job's environment and add steps to print that environment prior to the webhook attempting to pass it as the body. It'd be much cleaner and nicer to have the webhook JS code do this error logging for us.
Author
Owner

@chandlerc commented on GitHub (Apr 15, 2021):

:sigh:

It seems the github action UI already supports this and I just didn't realize it. Nevermind. Sorry for the noise.

@chandlerc commented on GitHub (Apr 15, 2021): :sigh: It seems the github action UI already supports this and I just didn't realize it. Nevermind. Sorry for the noise.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/webhook-action#10