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

GitHub Action

JSONbin Action

v2.0.0

JSONbin Action

trash

JSONbin Action

This action allows to generate custom HTTP responses using JSONbin service

Installation

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

              

- name: JSONbin Action

uses: fabasoad/jsonbin-action@v2.0.0

Learn more about this action in fabasoad/jsonbin-action

Choose a version

JSONbin

Releases Functional Tests pre-commit.ci status

This action allows to generate custom HTTP responses using JSONbin.io.

Prerequisites

API key

Sign up to JSONbin official web page. Then go to API Keys and copy api key to use it in action.

Pre-install

The following tools have to be installed for successful work of this GitHub action: bash, jq, curl.

Inputs

Name Required Description Default Possible values
api_key Yes JSONbin API Key <string>
body No Body to send in JSON format. In case you want to CREATE or UPDATE bin. null <json>
method No Type of response that you want to send. Possible values are CREATE, UPDATE, DELETE. Default is CREATE. CREATE CREATE, UPDATE, DELETE
bin_id No In case you want to UPDATE or DELETE bin. null <string>

Outputs

Name Required Description
bin_id Yes ID of a bin that has been created, updated or deleted
url Yes Access URL to a bin

Example usage

Workflow configuration

name: JSONbin

on: push

jobs:
  jsonbin:
    name: Test JSONbin
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@main
      - uses: fabasoad/jsonbin-action@main
        id: jsonbin
        with:
          body: '{"workflow": "${{ github.workflow }}", "author": "${{ github.actor }}", "number": "${{ github.run_number }}"}'
          method: 'CREATE'
          api_key: ${{ secrets.API_KEY }}
      - name: Check bin_id
        run: |
          echo "Bin ID = ${{ steps.jsonbin.outputs.bin_id }}"
          echo "URL = ${{ steps.jsonbin.outputs.url }}"

Result

Bin ID = 5e93fsb6b08d064dc025e226
URL = https://api.jsonbin.io/b/5e93fsb6b08d064dc025e226