Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabasoad/jsonbin-action
This GitHub action generates custom HTTP responses using JSONbin service.
https://github.com/fabasoad/jsonbin-action
github-action github-actions json json-api mock storage
Last synced: about 2 months ago
JSON representation
This GitHub action generates custom HTTP responses using JSONbin service.
- Host: GitHub
- URL: https://github.com/fabasoad/jsonbin-action
- Owner: fabasoad
- License: mit
- Created: 2020-03-25T03:26:00.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T03:32:04.000Z (8 months ago)
- Last Synced: 2024-05-02T05:07:18.947Z (8 months ago)
- Topics: github-action, github-actions, json, json-api, mock, storage
- Homepage:
- Size: 2.81 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-actions - Generate Custom Response using JSONbin
- fucking-awesome-actions - Generate Custom Response using JSONbin
- awesome-workflows - Generate Custom Response using JSONbin
README
# JSONbin
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
![Releases](https://img.shields.io/github/v/release/fabasoad/jsonbin-action?include_prereleases)
![functional-tests](https://github.com/fabasoad/jsonbin-action/actions/workflows/functional-tests.yml/badge.svg)
![linting](https://github.com/fabasoad/jsonbin-action/actions/workflows/linting.yml/badge.svg)
![security](https://github.com/fabasoad/jsonbin-action/actions/workflows/security.yml/badge.svg)This action allows to generate custom HTTP responses using [JSONbin.io](https://jsonbin.io).
## Prerequisites
Sign up to [JSONbin](https://jsonbin.io) official web page. Then go to [API Keys](https://jsonbin.io/api-keys)
and copy api key to use it in action.## 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 | `""` | _<json>_ |
| method | No | Type of response that you want to send | `GET` | `GET`, `CREATE`, `UPDATE`, `DELETE` |
| bin_id | No | In case you want to GET, UPDATE or DELETE bin | `""` | _<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
```yaml
name: JSONbinon: 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
```text
Bin ID = 5e93fsb6b08d064dc025e226
URL = https://api.jsonbin.io/b/5e93fsb6b08d064dc025e226
```