Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkershner6/post-api-call-action
A GitHub action to make a POST call to any API
https://github.com/dkershner6/post-api-call-action
api github-actions
Last synced: 29 days ago
JSON representation
A GitHub action to make a POST call to any API
- Host: GitHub
- URL: https://github.com/dkershner6/post-api-call-action
- Owner: dkershner6
- License: apache-2.0
- Created: 2021-05-21T21:53:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-03T00:15:07.000Z (5 months ago)
- Last Synced: 2024-09-28T17:07:22.562Z (about 2 months ago)
- Topics: api, github-actions
- Language: TypeScript
- Homepage:
- Size: 1.21 MB
- Stars: 9
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webhook-action
GitHub Action that sends a POST request of any kind. This is a thin wrapper around Axios.post.
## Inputs
### `url`
**Required**: URL to send post request to.
### `data`
Optional: JSON string of data to pass into request. Default `"{}"`.
### `headers`
Optional: JSON string of headers to pass into request. Default `"{}"`.
### `params`
Optional: JSON string of query parameters to pass into request. Default `"{}"`.
## Example usage
```yaml
uses: dkershner6/post-api-call-action@v2
with:
url: ${{ secrets.API_URL }}
data: "{\"command\": \"publish\"}"
headers: "{\"Authorization\": \"Bearer ${{ secrets.API_KEY }}\"}"
params: "{\"content\": \"Test Content\"}"
```## Contributing
All contributions are welcome, please open an issue or pull request.
To use this repository:
1. `npm i -g pnpm` (if don't have pnpm installed)
2. `pnpm i`
3. `npx projen` (this will ensure everything is setup correctly, and you can run this command at any time)
4. Good to make your changes!
5. You can run `npx projen build` at any time to build the project.