Forked from gsemino/Runscope-template-Stoplight-GitHub-sync.json
Last active
September 19, 2017 16:56
-
-
Save heitortsergent/d07b5ad3e58f5b2d31216800c45cba6e to your computer and use it in GitHub Desktop.
This is a Runscope template for syncing your oas file in Stoplight with GitHub
This file contains hidden or 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
{ | |
"trigger_url": "https://api.runscope.com/radar/81de52ef-ccf6-4063-ba43-d4755b29d05f/trigger", | |
"name": "Stoplight-GitHub Sync", | |
"version": "1.0", | |
"exported_at": 1505331232, | |
"steps": [ | |
{ | |
"headers": {}, | |
"url": "https://api.stoplight.io/v1/versions/version-id-here/export/oas.json", | |
"variables": [ | |
{ | |
"source": "response_text", | |
"name": "json_body" | |
} | |
], | |
"multipart_form": [], | |
"step_type": "request", | |
"auth": {}, | |
"note": "Get OAS JSON", | |
"fragment": "", | |
"assertions": [ | |
{ | |
"comparison": "equal_number", | |
"value": 200, | |
"source": "response_status" | |
}, | |
{ | |
"comparison": "not_empty", | |
"value": null, | |
"source": "response_text" | |
} | |
], | |
"scripts": [], | |
"before_scripts": [], | |
"method": "GET" | |
}, | |
{ | |
"url": "https://api.github.com/repos/your-org-or-username/your-repo/path/to/oas.json", | |
"variables": [ | |
{ | |
"source": "response_json", | |
"property": "sha", | |
"name": "current_sha" | |
} | |
], | |
"multipart_form": [], | |
"step_type": "request", | |
"auth": {}, | |
"fragment": "", | |
"note": "Get SHA for Specific File", | |
"headers": { | |
"Authorization": [ | |
"token 12345678910" | |
] | |
}, | |
"assertions": [ | |
{ | |
"comparison": "equal_number", | |
"value": 200, | |
"source": "response_status" | |
}, | |
{ | |
"comparison": "not_empty", | |
"property": "", | |
"value": null, | |
"source": "response_json" | |
} | |
], | |
"scripts": [], | |
"before_scripts": [], | |
"method": "GET" | |
}, | |
{ | |
"body": "{\r\n \"message\": \"updated-runscope-{{timestamp}}\",\r\n \"sha\": \"{{current_sha}}\",\r\n \"content\": \"{{encode_base64({{json_body}})}}\"\r\n\r\n}", | |
"form": {}, | |
"url": "https://api.github.com/repos/your-org-or-username/your-repo/path/to/oas.json", | |
"variables": [], | |
"multipart_form": [], | |
"step_type": "request", | |
"auth": {}, | |
"fragment": "", | |
"note": "Commit on the Specific File", | |
"headers": { | |
"Content-Type": [ | |
"application/json" | |
], | |
"Authorization": [ | |
"token 12345678910" | |
] | |
}, | |
"assertions": [ | |
{ | |
"comparison": "equal_number", | |
"value": 200, | |
"source": "response_status" | |
}, | |
{ | |
"comparison": "not_empty", | |
"property": "", | |
"value": null, | |
"source": "response_json" | |
} | |
], | |
"scripts": [], | |
"before_scripts": [], | |
"method": "PUT" | |
} | |
], | |
"description": "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment