Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
arrow-right-circle

GitHub Action

Web Request Action

v1.1

Web Request Action

arrow-right-circle

Web Request Action

Send Web Request

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Web Request Action

uses: Satak/[email protected]

Learn more about this action in Satak/webrequest-action

Choose a version

Web Request Action

A GitHub Action to make a web request to any JSON API. Supports all HTTP methods, JSON payload and basic authentication.

Test Status

Usage

uses: satak/webrequest-action@master
with:
  url: https://webhook.site/${{ secrets.WEBHOOK_ID }}
  method: POST
  payload: '{"name": "${{ env.MY_NAME }}"}'
  headers: '{"Authentication": "Token ${{ env.TOKEN }}"}'
  username: ${{ secrets.BASIC_AUTH_UN }}
  password: ${{ secrets.BASIC_AUTH_PW }}

Inputs

Parameter Required Info
url true Web request URL endpoint
method true Web request method (GET, POST, PUT, PATCH, DELETE)
payload false Web request payload in JSON format
headers false Web request headers in JSON format
username false Basic auth username
password false Basic auth password

Outputs

Output format: JSON

{
  "output": {
    "url": "<str url>",
    "method": "<str method>",
    "payload": {},
    "time": "<str time>",
    "statusCode": "<int statusCode>"
  }
}

Example output usage

run: |
  $output = '${{ steps.webhook.outputs.output }}' | ConvertFrom-Json
  Write-Host "Time from output $($output.time) statusCode $($output.statusCode)"

License

MIT