[GH-ISSUE #10] Protecting webhook #715

Closed
opened 2026-04-16 13:52:52 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @wakebit on GitHub (May 23, 2020).
Original GitHub issue: https://github.com/joelwmale/webhook-action/issues/10

I use this package (https://github.com/adnanh/webhook) as webhook for server. It allows to protect webhook like this:

...
"match":
          {
            "type": "payload-hash-sha1",
            "secret": "<RANDOM-SECRET-STRING>",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
...

where RANDOM-SECRET-STRING is secret key that can be used in Github Webhooks. Is there feature for adding this header and secret key on this action?

Originally created by @wakebit on GitHub (May 23, 2020). Original GitHub issue: https://github.com/joelwmale/webhook-action/issues/10 I use this package (https://github.com/adnanh/webhook) as webhook for server. It allows to protect webhook like this: ``` ... "match": { "type": "payload-hash-sha1", "secret": "<RANDOM-SECRET-STRING>", "parameter": { "source": "header", "name": "X-Hub-Signature" } } ... ``` where RANDOM-SECRET-STRING is secret key that can be used in Github Webhooks. Is there feature for adding this header and secret key on this action?
Author
Owner

@beshur commented on GitHub (May 26, 2020):

You can just hide the secret in the repo secrets and use in the action as ${{ secrets.RANDOM_SECRET_STRING }}

See https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets

<!-- gh-comment-id:634059006 --> @beshur commented on GitHub (May 26, 2020): You can just hide the secret in the repo secrets and use in the action as `${{ secrets.RANDOM_SECRET_STRING }}` See https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
Author
Owner

@wakebit commented on GitHub (May 26, 2020):

@beshur, I know about Github Secrets. You dont understand my question.

I ask how to add header to this action like it does Github Webhooks when calling hook:
X-Hub-Signature: RANDOM-SECRET-STRING

As I understand, this action does not support headers. Maybe @joelwmale will add this feature.

<!-- gh-comment-id:634070663 --> @wakebit commented on GitHub (May 26, 2020): @beshur, I know about Github Secrets. You dont understand my question. I ask how to add header to this action like it does Github Webhooks when calling hook: `X-Hub-Signature: RANDOM-SECRET-STRING` As I understand, this action does not support headers. Maybe @joelwmale will add this feature.
Author
Owner

@beshur commented on GitHub (May 26, 2020):

I see, sorry.

Actually, this action only does curl on your WEBHOOK_URL with {data: $data}, so you can as easily do it yourself, until the custom headers are supported.

<!-- gh-comment-id:634123604 --> @beshur commented on GitHub (May 26, 2020): I see, sorry. Actually, this action only does `curl` on your `WEBHOOK_URL` with `{data: $data}`, so you can as easily do it yourself, until the custom headers are supported.
Author
Owner

@joelwmale commented on GitHub (Aug 26, 2020):

Custom headers are now supported as of v2.0.0. You could use these to add your signature with a custom string to protect your API.

<!-- gh-comment-id:680393684 --> @joelwmale commented on GitHub (Aug 26, 2020): Custom headers are now supported as of [v2.0.0](https://github.com/joelwmale/webhook-action/releases/tag/2.0.0). You could use these to add your signature with a custom string to protect your API.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/webhook-action#715