Skip to content

Commit

Permalink
fix($runkit): still trying to get it to work
Browse files Browse the repository at this point in the history
  • Loading branch information
faceyspacey committed Jun 18, 2017
1 parent a0a2e00 commit 73a9c08
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/utils.js
Expand Up @@ -44,10 +44,12 @@ const getCommitSha = eventType => {

export const setStatus = (status, context, description, success) => {
const runKitUrl = status.runKitUrl
delete status.runKitUrl

const params = {
...status,
sha: status.sha,
target_url: status.target_url,
owner: status.owner,
repo: status.repo,
context,
description,
state: success ? 'success' : 'failure',
Expand All @@ -62,16 +64,17 @@ export const setStatus = (status, context, description, success) => {

body: JSON.stringify(params),
})
.then(response => {
const err = response.success
const message = response.message
.then(res => res.json())
.then(res => {
const err = res.success
const message = res.message
// colored logging
context = `${context}:`.blue
description = description[success ? 'green' : 'red']

const log = `${context} ${description}`
console.log(log)
console.log('IT WORKED!', context, response)
console.log('IT WORKED!', context, res)
if (err) {
console.error(`${context}: Error creating status`, message)
}
Expand Down

0 comments on commit 73a9c08

Please sign in to comment.