2021-05-22 06:17:43 +08:00
|
|
|
# webhook-action
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2022-08-06 22:38:37 +08:00
|
|
|
GitHub Action that sends a POST request of any kind. This is a thin wrapper around Axios.post.
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
## Inputs
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
### `url`
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
**Required**: URL to send post request to.
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
### `data`
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
Optional: JSON string of data to pass into request. Default `"{}"`.
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
### `headers`
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
Optional: JSON string of headers to pass into request. Default `"{}"`.
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2022-08-06 22:38:37 +08:00
|
|
|
### `params`
|
|
|
|
|
|
|
|
Optional: JSON string of query parameters to pass into request. Default `"{}"`.
|
|
|
|
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
## Example usage
|
2021-05-22 05:53:33 +08:00
|
|
|
|
|
|
|
```yaml
|
2021-05-22 06:26:03 +08:00
|
|
|
uses: dkershner6/post-api-call-action@v1
|
2021-05-22 05:53:33 +08:00
|
|
|
with:
|
2021-05-22 06:17:43 +08:00
|
|
|
url: ${{ secrets.API_URL }}
|
2021-05-23 01:40:10 +08:00
|
|
|
data: "{\"command\": \"publish\"}"
|
|
|
|
headers: "{\"Authorization\": \"Bearer ${{ secrets.API_KEY }}\"}"
|
2022-08-06 22:38:37 +08:00
|
|
|
params: "{\"content\": \"Test Content\"}"
|
2021-05-22 05:53:33 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2021-05-22 06:17:43 +08:00
|
|
|
## Contributing
|
2021-05-22 05:53:33 +08:00
|
|
|
|
2021-05-22 06:26:03 +08:00
|
|
|
Feel free to open issues or submit PRs.
|