A Typescript Action that performs HTTP requests within your workflow. It supports GraphQL!
Argument | Description | Default |
---|---|---|
url | Endpoint to query | https://api.github.com. If graphql is set, then https://api.github.com/graphql |
method | HTTP method | GET |
headers | JSON encoded HTTP headers | Empty by default. If no headers are supplied, GraphQL queries will be sent with {'Content-Type': 'application/json'} |
data | JSON encoded HTTP request payload | |
graphql | GraphQL query/mutation to execute | Empty by default. If defined, the data field is automatically populated with this payload and the method is set to POST |
variables | JSON encoded variables for the GraphQL mutation | |
operation_name | name of the entrypoint GraphQL operation if multiple are defined in graphql |
|
fail_fast | wether to fail upon HTTP error responses (e.g. 400, 500) | false |
verbose | wether to print info-level statements or not | false |
Name | Description |
---|---|
status |
Numeric response status code |
headers |
JSON encoded response HTTP headers |
response |
JSON encoded response |
Complete workflow file examples for the majority of supported HTTP requests can be found in .github/workflows
.
uses: CamiloGarciaLaRotta/watermelon-http-client@v1
with:
url: 'https://jsonplaceholder.typicode.com/todos?id=1'
uses: CamiloGarciaLaRotta/watermelon-http-client@v1
with:
url: 'https://jsonplaceholder.typicode.com/todos'
method: post
data: '{ "title": "dummy-todo", "userId": 1, "completed": false }'
uses: CamiloGarciaLaRotta/watermelon-http-client@v1
with:
url: 'https://countries.trevorblades.com/'
graphql: |
{
country(code: "CO") {
name
emoji
}
}
uses: CamiloGarciaLaRotta/watermelon-http-client@v1
with:
headers: '{"Authorization": "bearer ${{ secrets.TOKEN }}", "Content-Type": "application/json" }'
graphql: |
mutation addRocketEmoji($reaction:AddReactionInput!) {
addReaction(input:$reaction) {
reaction {
content
}
subject {
id
}
}
}
variables: |
{
"reaction": {
"subjectId":"${{ secrets.ISSUE_ID }}",
"content":"ROCKET"
}
}
See the contribution guidelines ❤️