post-api-call/README.md

39 lines
759 B
Markdown
Raw Permalink Normal View History

2021-05-22 06:17:43 +08:00
# webhook-action
2021-05-22 05:53:33 +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
### `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 }}\"}"
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.