Skip to content

Commit

Permalink
Introduce status target url
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul6469 committed Feb 27, 2018
1 parent 5aa1b16 commit bc74cdc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/handle-pull-request-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ async function handlePullRequestChange (robot, context) {
context.github.repos.createStatus(context.repo({
sha: context.payload.pull_request.head.sha,
state: status,
target_url: 'https://github.com/apps/wip-pr',
description: isWip ? 'Work in progress' : 'Ready for review',
context: 'codereview/wip'
}))
Expand All @@ -19,6 +20,7 @@ async function handlePullRequestChange (robot, context) {
context.github.repos.createStatus(context.repo({
sha: context.payload.before,
state: 'success',
target_url: 'https://github.com/apps/wip-pr',
description: 'A new commit has been pushed',
context: 'codereview/wip'
}))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wip-pr",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions tests/retrostatus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const wipObject = {
'description': 'Work in progress',
'owner': 'user',
'repo': 'testing-things',
'target_url': 'https://github.com/apps/wip-pr',
'sha': 'sha',
'state': 'failure'
}
Expand All @@ -15,6 +16,7 @@ const successObject = {
'description': 'A new commit has been pushed',
'owner': 'user',
'repo': 'testing-things',
'target_url': 'https://github.com/apps/wip-pr',
'sha': 'shabefore',
'state': 'success'
}
Expand Down
1 change: 1 addition & 0 deletions tests/wip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const wipObject = {
'description': 'Work in progress',
'owner': 'user',
'repo': 'testing-things',
'target_url': 'https://github.com/apps/wip-pr',
'sha': 'sha',
'state': 'failure'
}
Expand Down

0 comments on commit bc74cdc

Please sign in to comment.