A GitHub action to make a POST call to any API
Go to file
Derek Kershner 30ecd56ecf
Merge pull request #2 from dkershner6/DAK/params
Added params as an optional parameter (query parameters)
2022-08-06 07:41:14 -07:00
.github/workflows With build 2021-05-21 15:20:27 -07:00
dist Added params as an optional parameter (query parameters) 2022-08-06 07:38:37 -07:00
src Added params as an optional parameter (query parameters) 2022-08-06 07:38:37 -07:00
.eslintignore Initial commit 2021-05-21 14:53:33 -07:00
.eslintrc Initial commit 2021-05-21 14:53:33 -07:00
.gitignore Initial commit 2021-05-21 14:53:33 -07:00
.prettierignore Update README, add test for parsing 2021-05-22 10:40:10 -07:00
.prettierrc Initial commit 2021-05-21 14:53:33 -07:00
action.yml Added params as an optional parameter (query parameters) 2022-08-06 07:38:37 -07:00
jest.config.js Added params as an optional parameter (query parameters) 2022-08-06 07:38:37 -07:00
LICENSE Initial commit 2021-05-21 14:53:33 -07:00
package-lock.json Added params as an optional parameter (query parameters) 2022-08-06 07:38:37 -07:00
package.json Added params as an optional parameter (query parameters) 2022-08-06 07:38:37 -07:00
README.md Added params as an optional parameter (query parameters) 2022-08-06 07:38:37 -07:00
tsconfig.json Initial commit 2021-05-21 14:53:33 -07:00

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

uses: dkershner6/post-api-call-action@v1
with:
  url: ${{ secrets.API_URL }}
  data: "{\"command\": \"publish\"}"
  headers: "{\"Authorization\": \"Bearer ${{ secrets.API_KEY }}\"}"
  params: "{\"content\": \"Test Content\"}"

Contributing

Feel free to open issues or submit PRs.