From 33e1550e71b871d95195d4b6dc4fa868fe09c795 Mon Sep 17 00:00:00 2001 From: "Mike P. Sinn" Date: Mon, 10 Dec 2018 18:13:05 -0600 Subject: [PATCH 1/2] Allow for target_url on statuses --- .gitignore | 1 + index.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3cdc0ad..e5f98f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules coverage artifacts +.idea/ diff --git a/index.js b/index.js index 356d58c..e8124e1 100644 --- a/index.js +++ b/index.js @@ -59,14 +59,16 @@ var commentToPR = function (body, opt, cb) { }; var createStatusToCommit = function (state, opt, cb) { - getGIT(opt).repos.createStatus({ + var statusOptions = { user: opt.git_repo.split('/')[0], repo: opt.git_repo.split('/')[1], sha: opt.git_sha, state: state.state, description: state.description, context: state.context - }, cb); + }; + if(state.target_url){statusOptions.target_url = state.target_url;} + getGIT(opt).repos.createStatus(statusOptions, cb); }; var isPullRequest = function (opt) { From 5d5ec40d17056e0ab86209197ba3e2b79ee2e9d3 Mon Sep 17 00:00:00 2001 From: "Mike P. Sinn" Date: Mon, 10 Dec 2018 18:17:36 -0600 Subject: [PATCH 2/2] Added target_url to README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 954a38f..c940fb9 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ gulp.task('lint_report_github', function () { console.log(E.message); // This handled jscs stream error. }) .pipe(eslint()) - .pipe(github(options)); // Comment issues in github PR! + .pipe(github(options)) // Comment issues in github PR! .pipe(github.failThisTask()); // Fail this task when jscs/jshint/eslint issues found. }); @@ -54,7 +54,8 @@ github.commentToPR('Yes! it works!!', options); github.createStatusToCommit({ description: 'No! 2 failures...', context: 'my gulp task', - state: 'failure' + state: 'failure', + target_url: 'http://www.homerswebpage.com/' }, options); // Or, create a task to reject PR with merged commits