Bump fjogeleit/http-request-action from 1.16.2 to 1.16.3 #175
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Functional Tests | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
jobs: | |
functional-tests: | |
name: Test JSONbin | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ${{ github.repository }} | |
uses: actions/checkout@v4 | |
- name: Create bin | |
uses: ./ | |
id: jsonbin_create | |
with: | |
body: '{"running_by":"${{ github.actor }}"}' | |
method: "CREATE" | |
api_key: "${{ secrets.API_KEY }}" | |
- name: Validate output | |
run: | | |
[[ $(expr length "${{ steps.jsonbin_create.outputs.bin_id }}") -eq 0 ]] && exit 1; | |
[[ "${{ steps.jsonbin_create.outputs.url }}" == "https://api.jsonbin.io/v3/b/${{ steps.jsonbin_create.outputs.bin_id }}" ]] || exit 1; | |
- name: Call URL that was returned | |
uses: fjogeleit/http-request-action@v1.16.3 | |
id: http1 | |
with: | |
url: "${{ steps.jsonbin_create.outputs.url }}" | |
method: "GET" | |
customHeaders: '{"X-Master-Key": "${{ secrets.API_KEY }}"}' | |
- name: Validate response | |
run: | | |
[[ "$(jq -c '.record' <<< '${{ steps.http1.outputs.response }}')" == '{"running_by":"${{ github.actor }}"}' ]] || exit 1; | |
- name: Get bin | |
uses: ./ | |
id: jsonbin_get | |
with: | |
bin_id: "${{ steps.jsonbin_create.outputs.bin_id }}" | |
method: "GET" | |
api_key: "${{ secrets.API_KEY }}" | |
- name: Validate output | |
run: | | |
[[ $(expr length "${{ steps.jsonbin_get.outputs.bin_id }}") -eq 0 ]] && exit 1; | |
[[ "${{ steps.jsonbin_get.outputs.url }}" == "https://api.jsonbin.io/v3/b/${{ steps.jsonbin_get.outputs.bin_id }}" ]] || exit 1; | |
- name: Call URL that was returned | |
uses: fjogeleit/http-request-action@v1.16.3 | |
id: http2 | |
with: | |
url: "${{ steps.jsonbin_get.outputs.url }}" | |
method: "GET" | |
customHeaders: '{"X-Master-Key": "${{ secrets.API_KEY }}"}' | |
- name: Validate response | |
run: | | |
[[ "$(jq -c '.record' <<< '${{ steps.http2.outputs.response }}')" == '{"running_by":"${{ github.actor }}"}' ]] || exit 1; | |
- name: Update bin | |
uses: ./ | |
id: jsonbin_update | |
with: | |
body: '{"author":"${{ github.actor }}"}' | |
method: "UPDATE" | |
bin_id: "${{ steps.jsonbin_create.outputs.bin_id }}" | |
api_key: "${{ secrets.API_KEY }}" | |
- name: Call URL that was returned | |
uses: fjogeleit/http-request-action@v1.16.3 | |
id: http3 | |
with: | |
url: "${{ steps.jsonbin_update.outputs.url }}" | |
method: "GET" | |
customHeaders: '{"X-Master-Key": "${{ secrets.API_KEY }}"}' | |
- name: Validate response | |
run: | | |
[[ "$(jq -c '.record' <<< '${{ steps.http3.outputs.response }}')" == '{"author":"${{ github.actor }}"}' ]] || exit 1; | |
- name: Delete bin | |
uses: ./ | |
id: jsonbin_delete | |
with: | |
bin_id: "${{ steps.jsonbin_update.outputs.bin_id }}" | |
method: "DELETE" | |
api_key: "${{ secrets.API_KEY }}" | |
- name: Validate URL does not exist | |
run: | | |
[[ $(curl -s -o /dev/null -w "%{http_code}" ${{ steps.jsonbin_update.outputs.url }}) -eq 404 ]] || exit 1; |