feat: finish updates & adding github event support

This commit is contained in:
Joel Male
2024-03-28 13:00:21 +10:00
parent a976623266
commit 14b045decf
11 changed files with 234 additions and 26 deletions
+42 -2
View File
@@ -20,7 +20,7 @@ Example:
url: ${{ secrets.WEBHOOK_URL }}
headers: '{"repository": "joelwmale/webhook-action"}'
body: '{"event": "deployment", "repository": "joelwmale/webhook-action"}'
github_event: ${{ toJson(github.event) }}
github_event_payload: true
```
It is **highly** recommended to use the action is an explicit commit SHA-1:
@@ -35,12 +35,28 @@ The action has support for the following input variables (arguments):
* **`headers`** (**optional**): Any headers you want to be sent with the webhook
* **`body`** (**optional**): The body of data send with the webhook
* **`insecure`** (**optional**): Enables calling to known self-signed or invalid SSL certificates
* **`github_event`** (**optional**): Enables forwarding the Github event to your webhook
* **`github_event_payload`** (**optional**): Enables forwarding the Github event payload to your webhook.
You can find more information on how to use these input variables below.
## Arguments
#### URL
**Required:** true
The URL to send the webhook to
```yml
url: ${{ secrets.WEBHOOK_URL }}
```
or
```yml
url: https://webhook.site/8b1b1b1b-8b1b-8b1b-8b1b-8b1b1b1b1b1b
```
#### Headers
**Required:** false
@@ -62,6 +78,30 @@ Allows you to send a custom JSON object to the webhook
body: '{"event": "deployment", "repository": "joelwmale/webhook-action"}'
```
#### Insecure
**Required:** false
**Default:** false
Allows you to send a webhook to a known self-signed or invalid SSL certificate
```yml
insecure: true
```
#### Github Event Payload
**Required:** false
**Default:** false
Allows you to send the Github event payload to your webhook
The payload will be sent as a JSON object under the key `githubEventPayload` on the root of the payload sent to your webhook
```yml
github_event_payload: true
```
## Issues
If you find any issues or have an improvement feel free to [submit an issue](https://github.com/joelwmale/webhook-action/issues/new)