Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
This is a Runscope template for syncing your oas file in Stoplight with GitHub
{
"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