Skip to content

Test

Test #66

Workflow file for this run

on: [push, workflow_dispatch]
name: Test
env:
MY_NAME: testUser
jobs:
webrequest_test:
runs-on: ubuntu-latest
name: Test POST and GET web requests
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node for testing
uses: actions/setup-node@master
- run: npm install
- run: npm test
- name: post-request output
shell: pwsh
run: |
$output = '${{ steps.post-request.outputs.output }}' | ConvertFrom-Json
Write-Host "Time from output $($output.time) statusCode $($output.statusCode)"
$output.statusCode -eq 200
- name: GET request
id: get-request
uses: satak/webrequest-action@master
with:
url: https://my-json-server.typicode.com/typicode/demo/posts
method: GET
- name: get-request output
shell: pwsh
run: |
$output = '${{ steps.get-request.outputs.output }}' | ConvertFrom-Json
$output.data[0].id -eq 1