diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 90% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index eed6d6d..4c6066d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,9 @@ on: [push] +name: Test env: - MY_NAME: Satak the great + MY_NAME: testUser jobs: - webhook_job: + webhook_test_job: runs-on: ubuntu-latest name: Job to send payload to webhook API steps: @@ -23,3 +24,4 @@ jobs: run: | $output = '${{ steps.webhook.outputs.output }}' | ConvertFrom-Json Write-Host "Time from output $($output.time) statusCode $($output.statusCode)" + $output.statusCode -eq 200 diff --git a/README.md b/README.md index 1bb1193..b7ee405 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,10 @@ # Web Request Action -This action makes a web request to any JSON API. Supports all HTTP methods, JSON payload and basic authentication. +> A GitHub Action to make a web request to any JSON API. Supports all HTTP methods, JSON payload and basic authentication. -## Inputs - -| Parameter | Required | Info | -| ---------- | -------- | -------------------------------------------------- | -| `url` | `true` | Web request URL endpoint | -| `method` | `true` | Web request method (`GET`, `POST`, `PUT`, `PATCH`) | -| `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 | +[![Test Status](https://github.com/satak/webrequest-action/workflows/Test/badge.svg)](https://github.com/satak/webrequest-action/actions) -## Example usage +## Usage ```yaml uses: satak/webrequest-action@master @@ -26,6 +17,17 @@ with: password: ${{ secrets.BASIC_AUTH_PW }} ``` +## Inputs + +| Parameter | Required | Info | +| ---------- | -------- | -------------------------------------------------- | +| `url` | `true` | Web request URL endpoint | +| `method` | `true` | Web request method (`GET`, `POST`, `PUT`, `PATCH`) | +| `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` @@ -49,3 +51,7 @@ run: | $output = '${{ steps.webhook.outputs.output }}' | ConvertFrom-Json Write-Host "Time from output $($output.time) statusCode $($output.statusCode)" ``` + +## License + +[MIT](LICENSE)