mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-06-12 10:45:58 -05:00
[GH-ISSUE #17] Error with triggering webhook #2077
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AnandChowdhary on GitHub (Aug 26, 2020).
Original GitHub issue: https://github.com/joelwmale/webhook-action/issues/17
Since v2, I'm getting an error triggering webhooks. The webhook is a long Caprover URL that looks like this, and is stored as a secret in the GitHub repository:
https://example.environment.domain.com/api/v2/user/apps/webhooks/triggerbuild?namespace=captain&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InRva2VuVmVyc2lvbiI6ImE1Njk1Mjg1LTEyMzQtNTY3OC04OTA0LTE2YTg3NTNiZGI3YyIsImFwcE5hbWUiOiJhcGkiLCJuYW1lc3BhY2UiOiJjYXB0YWluIn0sImlhdCI6MTU5NDU3ODQ5NH0.9nQzitytlOx5xo8CDgU1-1pa1rIlF8SXToC402V7MlE
This is the error:
This is the configuration:
@Evanfeenstra commented on GitHub (Aug 26, 2020):
Same here, and my URL is not super long. FYI you can use the previous version by specifying the commit hash
uses: joelwmale/webhook-action@749e2dcbc6735ce0c36e1dbbb660618cd7b5f91c@joelwmale commented on GitHub (Aug 26, 2020):
@AnandChowdhary Using the URL you provided as an example I cannot replicate the error. I do get a failed to reach host as obviously the URL does not point anywhere but that goes past the check to see if the URL is a well-formatted URL or not.
Are you able to find another URL that is failing that you are able to provide?
@ok200paul commented on GitHub (Aug 27, 2020):
Seeing this also. The webhook URL I'm using triggers deployments so I can't share it here, but I can confirm that it (the deployment URL) is still working, is not super-long, and the webhook action is failing. Excellent action btw, thanks so much for putting it together!
@AnandChowdhary commented on GitHub (Aug 27, 2020):
I created a repo so you can reproduce it: https://github.com/AnandChowdhary/joelwmale-webhook-action-17
Failing action: https://github.com/AnandChowdhary/joelwmale-webhook-action-17/runs/1035325989?check_suite_focus=true
Workflow: https://github.com/AnandChowdhary/joelwmale-webhook-action-17/blob/master/.github/workflows/test.yml
Secrets has
EXAMPLE_URLset to https://example.com:@joelwmale commented on GitHub (Aug 27, 2020):
@AnandChowdhary is the webhook being hit with the post request at all? Or is it just not making the request?
@AnandChowdhary commented on GitHub (Aug 27, 2020):
I've changed the secret to a RequestBin.com URL so I can see all requests to it (https://en5cm912o0dug.x.pipedream.net/).
Here's the test with the new URL: https://github.com/AnandChowdhary/joelwmale-webhook-action-17/runs/1035357460
No requests have been made.
@joelwmale commented on GitHub (Aug 27, 2020):
@AnandChowdhary That's odd because I'm using a requestbin url and I get no errors: https://github.com/joelwmale/test/blob/master/.github/workflows/deploy.yml (where @develop is the current @master)
@joelwmale commented on GitHub (Aug 27, 2020):
@AnandChowdhary Can you try removing the
/at the end?@AnandChowdhary commented on GitHub (Aug 27, 2020):
Can you try using a GitHub secret rather than a hard-coded URL? I think that's somehow the problem...
@AnandChowdhary commented on GitHub (Aug 27, 2020):
Aah, you're using
withinstead ofenv. I'm almost certain that's the issue, v2 is no longer checkingprocess.env.for the URL.@joelwmale commented on GitHub (Aug 27, 2020):
@AnandChowdhary Ah sorry I did not notice that in your initial comment. Yes, I migrated to
withinstead ofenvfor this update since it's now using JS/TS and not Bash. Can you try that and let me know?I will update the code to check for at least the URL existing in a well-formatted format but hopefully, that fixes your issue.
@AnandChowdhary commented on GitHub (Aug 27, 2020):
Yes, it works. I've added a PR to add support for environment variables in v1 back to v2.
@joelwmale commented on GitHub (Aug 27, 2020):
@AnandChowdhary Great. Left a small comment on the PR for you.
@Evanfeenstra @ok200paul Can you guys please use
withor continue usingenvafter the PR is released? I'm closing this now and will continue discussions on the PR. Thanks for the help @AnandChowdhary!@joelwmale commented on GitHub (Aug 27, 2020):
@AnandChowdhary @Evanfeenstra @ok200paul When your workflow pulls the latest version (if you have it set to @master) it will work once more. If you are targetting a release @2.0.0, please update this to @2.0.1.
Thanks for the feedback & help guys.