{"id":15693529,"url":"https://github.com/zordius/gulp-github","last_synced_at":"2025-05-08T04:22:13.987Z","repository":{"id":25260260,"uuid":"28685419","full_name":"zordius/gulp-github","owner":"zordius","description":"A gulp plugin to comment jscs/jshint/eslint issues to a github pull request.","archived":false,"fork":false,"pushed_at":"2018-12-13T02:02:33.000Z","size":92,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T13:57:47.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gulp-github","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zordius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-01T11:28:34.000Z","updated_at":"2018-12-13T02:02:35.000Z","dependencies_parsed_at":"2022-08-30T11:32:12.389Z","dependency_job_id":null,"html_url":"https://github.com/zordius/gulp-github","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgulp-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgulp-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgulp-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgulp-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zordius","download_url":"https://codeload.github.com/zordius/gulp-github/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252997549,"owners_count":21837838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T18:45:02.300Z","updated_at":"2025-05-08T04:22:13.969Z","avatar_url":"https://github.com/zordius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"gulp-github\n===========\n\nA gulp plugin to comment jscs/jshint/eslint issues to a github pull request.\n\n[![npm version](https://img.shields.io/npm/v/gulp-github.svg)](https://www.npmjs.org/package/gulp-github) [![Dependency Status](https://david-dm.org/zordius/gulp-github.svg)](https://david-dm.org/zordius/gulp-github) [![Build Status](https://travis-ci.org/zordius/gulp-github.svg?branch=master)](https://travis-ci.org/zordius/gulp-github) [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.txt)\n\nFeatures\n--------\n\n* See your CI issues of lint tools on github!\n  * Collect \u003ca href=\"https://github.com/spenceralger/gulp-jshint\"\u003egulp-jshint\u003c/a\u003e results.\n  * Collect \u003ca href=\"https://github.com/jscs-dev/gulp-jscs\"\u003egulp-jscs\u003c/a\u003e results.\n  * Collect \u003ca href=\"https://github.com/adametry/gulp-eslint\"\u003egulp-eslint\u003c/a\u003e results.\n  * Write collected info then comment on a github pull request.\n  * Update github pull request status based on collected info.\n* A failThisTask() reporter to fail a gulp task when jscs/jshint/eslint issues found\n* **TODO** Collect lcov result.\n\n\u003cimg src=\"demo.png\" /\u003e\n\nInstallation\n------------\n\n```sh\nnpm install gulp-github\n```\n\nUsage\n-----\n\n```javascript\nvar gulp = require('gulp'),\n    jshint = require('gulp-jshint'),\n    jscs = require('gulp-jscs'),\n    eslint = require('gulp-eslint'),\n    github = require('gulp-github');\n\ngulp.task('lint_report_github', function () {\n    return gulp.src('lib/*.js')\n    .pipe(jshint())\n    .pipe(jscs()).on('error', function (E) {\n        console.log(E.message);   // This handled jscs stream error.\n    })\n    .pipe(eslint())\n    .pipe(github(options))       // Comment issues in github PR!\n    .pipe(github.failThisTask()); // Fail this task when jscs/jshint/eslint issues found.\n});\n\n// Or, direct output your comment with same options\ngithub.commentToPR('Yes! it works!!', options);\n\n// Or, direct set status to a commit\ngithub.createStatusToCommit({\n   description: 'No! 2 failures...',\n   context: 'my gulp task',\n   state: 'failure',\n   target_url: 'http://www.homerswebpage.com/'\n}, options);\n\n// Or, create a task to reject PR with merged commits\ngulp.task('git_rules', function (cb) {\n    git.failMergedPR(options, cb);\n});\n```\n\nOptions\n-------\n\n```javascript\n{\n    // Required options: git_token, git_repo\n    // refer to https://help.github.com/articles/creating-an-access-token-for-command-line-use/\n    git_token: 'your_github_oauth_token',\n\n    // comment into this repo, this pr.\n    git_repo: 'zordius/test',\n    git_prid: '1',\n\n    // create status to this commit, optional\n    git_sha: 00000000,\n    jshint_status: 'error',       // Set status to error when jshint errors, optional\n    jscs_status: 'failure',       // Set git status to failure when jscs errors, optional\n    eslint_status: 'error',       // Set git status to error when eslint errors, optional\n\n    // when using github enterprise, optional\n    git_option: {\n        // refer to https://www.npmjs.com/package/github for more options\n        host: 'github.mycorp.com',\n        // You may require this when you using Enterprise Github\n        pathPrefix: '/api/v3'\n    },\n\n    // Provide your own jshint reporter, optional\n    jshint_reporter: function (E, file) { // gulp stream file object\n        // refer to http://jshint.com/docs/reporters/ for E structure.\n        return 'Error in ' + E.file + '!';\n    },\n\n    // Provide your own jscs reporter, optional\n    jscs_reporter: function (E, file) { // gulp stream file object\n        // refer to https://github.com/jscs-dev/node-jscs/wiki/Error-Filters for E structure.\n        return 'Error in ' + E.filename + '!';\n    }\n}\n```\n\nCheck this \u003ca href=\"gulpfile.js\"\u003esample gulpfile\u003c/a\u003e to see how to migrate this with travis CI.\n\nCheck \u003ca href=\"https://github.com/zordius/gulp-github/pull/4\"\u003eThis PR\u003c/a\u003e to see live demo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fgulp-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzordius%2Fgulp-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fgulp-github/lists"}