+
Skip to content

Allow for target_url on statuses #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
coverage
artifacts
.idea/
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
});

Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载