2022-11-03 09:19:36 -04:00
|
|
|
name: CI
|
2020-04-21 07:44:56 -04:00
|
|
|
|
2022-11-03 09:19:36 -04:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- 'releases/*'
|
2020-04-21 07:44:56 -04:00
|
|
|
|
|
|
|
jobs:
|
2022-11-03 09:19:36 -04:00
|
|
|
build:
|
2022-11-03 16:35:53 -04:00
|
|
|
if: >
|
|
|
|
github.event_name == 'pull_request' &&
|
|
|
|
github.event.pull_request.user.login == 'dependabot[bot]'
|
2022-11-03 09:19:36 -04:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2020-04-21 07:44:56 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-11-03 09:19:36 -04:00
|
|
|
- id: ref
|
|
|
|
run: |
|
|
|
|
if [[ -n '${{ github.event.ref }}' ]]; then
|
|
|
|
branch="${{ github.event.ref }}"
|
|
|
|
echo "branch=$branch" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
branch="${{ github.event.pull_request.head.ref }}"
|
|
|
|
echo "branch=$branch" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
- name: checkout repo
|
2023-10-01 13:35:20 -04:00
|
|
|
uses: actions/checkout@v4
|
2022-11-03 09:19:36 -04:00
|
|
|
with:
|
|
|
|
ref: ${{ steps.ref.outputs.branch }}
|
2023-11-01 13:51:26 -04:00
|
|
|
- uses: actions/setup-node@v4
|
2022-11-03 09:19:36 -04:00
|
|
|
with:
|
|
|
|
node-version: '16'
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
- name: Build Action
|
|
|
|
run: |
|
|
|
|
npm run build
|
|
|
|
- name: Update dist
|
|
|
|
run: |
|
|
|
|
git config user.name 'github-actions[bot]'
|
|
|
|
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
|
|
|
git add ./dist
|
|
|
|
if ! git diff --quiet dist; then
|
|
|
|
git commit -m "Update dist"
|
|
|
|
git push origin HEAD:${{ steps.ref.outputs.branch }}
|
|
|
|
fi
|
2022-11-03 16:35:53 -04:00
|
|
|
integrity:
|
|
|
|
if: >
|
|
|
|
!failure() &&
|
|
|
|
!cancelled()
|
2022-11-03 09:19:36 -04:00
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-03 16:35:53 -04:00
|
|
|
steps:
|
|
|
|
- name: checkout repo
|
2023-10-01 13:35:20 -04:00
|
|
|
uses: actions/checkout@v4
|
2022-11-03 16:35:53 -04:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2023-11-01 13:51:26 -04:00
|
|
|
- uses: actions/setup-node@v4
|
2022-11-03 16:35:53 -04:00
|
|
|
with:
|
|
|
|
node-version: '16.17.0'
|
|
|
|
- name: Build action
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run build
|
|
|
|
- name: Repository Integrity Check
|
|
|
|
run: |
|
|
|
|
git diff --quiet dist
|
|
|
|
test:
|
|
|
|
if: >
|
|
|
|
!failure() &&
|
|
|
|
!cancelled()
|
|
|
|
needs:
|
|
|
|
- integrity
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-03 09:19:36 -04:00
|
|
|
steps:
|
2023-10-01 13:35:20 -04:00
|
|
|
- uses: actions/checkout@v4
|
2020-04-21 07:44:56 -04:00
|
|
|
with:
|
|
|
|
ref: ${{ github.ref }}
|
|
|
|
|
2021-07-22 08:52:06 -04:00
|
|
|
- name: Request Postman Echo GET
|
2020-04-21 07:44:56 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
2020-04-21 07:55:30 -04:00
|
|
|
url: 'https://postman-echo.com/get'
|
2020-04-21 07:44:56 -04:00
|
|
|
method: 'GET'
|
2020-04-21 07:58:56 -04:00
|
|
|
|
2021-07-22 08:52:06 -04:00
|
|
|
- name: Request Postman Echo POST
|
2020-04-21 07:58:56 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
method: 'POST'
|
|
|
|
data: '{ "key": "value" }'
|
2020-04-21 08:07:56 -04:00
|
|
|
|
2021-07-22 08:52:06 -04:00
|
|
|
- name: Request Postman Echo POST with Unescaped Newline
|
2020-10-07 12:29:38 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
method: 'POST'
|
|
|
|
escapeData: 'true'
|
|
|
|
data: >-
|
|
|
|
{
|
|
|
|
"key":"multi line\ntest
|
|
|
|
text"
|
|
|
|
}
|
|
|
|
|
2021-07-22 08:52:06 -04:00
|
|
|
- name: Request Postman Echo BasicAuth
|
2020-04-21 08:07:56 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/basic-auth'
|
2020-04-21 08:09:38 -04:00
|
|
|
method: 'GET'
|
2020-04-21 08:07:56 -04:00
|
|
|
username: 'postman'
|
|
|
|
password: 'password'
|
2021-01-24 07:14:13 -05:00
|
|
|
|
2021-07-22 08:52:06 -04:00
|
|
|
- name: Request Postman Echo with 404 Response and ignore failure code
|
2021-03-19 12:28:53 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/status/404'
|
|
|
|
method: 'GET'
|
|
|
|
ignoreStatusCodes: '404'
|
|
|
|
|
2021-01-24 07:14:13 -05:00
|
|
|
- name: Create Test File
|
|
|
|
run: |
|
2023-11-30 08:07:10 -05:00
|
|
|
echo "test" > testfile1.txt
|
|
|
|
echo "test" > testfile2.txt
|
|
|
|
|
2021-07-22 08:52:06 -04:00
|
|
|
- name: Request Postman Echo POST Multipart
|
2021-01-24 07:14:13 -05:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
method: 'POST'
|
|
|
|
data: '{ "key": "value" }'
|
2023-11-30 08:07:10 -05:00
|
|
|
files: '{ "file": "${{ github.workspace }}/testfile1.txt" }'
|
|
|
|
|
|
|
|
- name: Request Postman Echo POST Multipart File Array
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
method: 'POST'
|
|
|
|
data: '{ "key": "value" }'
|
|
|
|
files: '{ "file": ["${{ github.workspace }}/testfile1.txt", "${{ github.workspace }}/testfile2.txt"] }'
|
2022-02-09 22:14:07 -05:00
|
|
|
|
2023-02-04 07:28:08 -05:00
|
|
|
- name: Request Postman Echo POST and persist response
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
method: 'POST'
|
2023-11-30 08:07:10 -05:00
|
|
|
file: "${{ github.workspace }}/testfile1.txt"
|
2023-02-04 07:28:08 -05:00
|
|
|
responseFile: "${{ github.workspace }}/response.json"
|
|
|
|
- name: Output responseFile
|
|
|
|
run: |
|
|
|
|
cat "${{ github.workspace }}/response.json"
|
|
|
|
|
2022-10-05 11:29:30 -04:00
|
|
|
- name: Request Postman Echo POST Multipart without data
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
method: 'POST'
|
2023-11-30 08:07:10 -05:00
|
|
|
files: '{ "file": "${{ github.workspace }}/testfile1.txt" }'
|
2022-10-05 11:29:30 -04:00
|
|
|
|
2022-02-09 22:14:07 -05:00
|
|
|
- name: Request Postman Echo POST single file
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
method: 'POST'
|
2023-11-30 08:07:10 -05:00
|
|
|
file: "${{ github.workspace }}/testfile1.txt"
|
2022-11-07 05:08:34 -05:00
|
|
|
|
|
|
|
- name: Request Postman Echo POST URLEncoded string data
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
contentType : 'application/x-www-form-urlencoded'
|
|
|
|
method: 'POST'
|
|
|
|
data: 'key=value'
|
|
|
|
|
|
|
|
- name: Request Postman Echo POST URLEncoded json data
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
url: 'https://postman-echo.com/post'
|
|
|
|
contentType : 'application/x-www-form-urlencoded'
|
|
|
|
method: 'POST'
|
|
|
|
data: '{"key":"value"}'
|