@semantic-release/github
Advanced tools
Comparing version 4.2.15 to 4.2.16
@@ -23,3 +23,5 @@ const {template} = require('lodash'); | ||
debug('create comment: %O', comment); | ||
const {data: {html_url: url}} = await github.issues.createComment(comment); | ||
const { | ||
data: {html_url: url}, | ||
} = await github.issues.createComment(comment); | ||
logger.log('Added comment to issue #%d: %s.', srIssue.number, url); | ||
@@ -29,5 +31,7 @@ } else { | ||
debug('create issue: %O', newIssue); | ||
const {data: {html_url: url, number}} = await github.issues.create(newIssue); | ||
const { | ||
data: {html_url: url, number}, | ||
} = await github.issues.create(newIssue); | ||
logger.log('Created issue #%d: %s.', number, url); | ||
} | ||
}; |
const ISSUE_ID = require('./definitions/sr-issue-id'); | ||
module.exports = async (github, title, owner, repo) => { | ||
const {data: {items: issues}} = await github.search.issues({ | ||
const { | ||
data: {items: issues}, | ||
} = await github.search.issues({ | ||
q: `in:title+repo:${owner}/${repo}+type:issue+state:open+${title}`, | ||
@@ -6,0 +8,0 @@ }); |
@@ -54,4 +54,4 @@ const {memoize} = require('lodash'); | ||
* @param {Array} limit The rate limits per API endpoints. | ||
* @param {Throttler} globalThrottler The throller function for the global rate limit. | ||
* @param {String} endpoint The API endpoint to handle. | ||
* @param {Throttler} globalThrottler The throller function for the global rate limit. | ||
* @return {Function} The `handler` for a `Proxy` wrapping an Octokit instance. | ||
@@ -69,3 +69,3 @@ */ | ||
get: (target, name, receiver) => | ||
Object.prototype.hasOwnProperty.call(target, name) | ||
Reflect.apply(Object.prototype.hasOwnProperty, target, [name]) | ||
? new Proxy(target[name], handler(retry, limit, globalThrottler, endpoint || name)) | ||
@@ -72,0 +72,0 @@ : Reflect.get(target, name, receiver), |
@@ -22,3 +22,5 @@ const {basename, extname} = require('path'); | ||
const {data: {html_url: url, upload_url: uploadUrl}} = await github.repos.createRelease(release); | ||
const { | ||
data: {html_url: url, upload_url: uploadUrl}, | ||
} = await github.repos.createRelease(release); | ||
logger.log('Published GitHub release: %s', url); | ||
@@ -62,3 +64,5 @@ | ||
const {data: {browser_download_url: downloadUrl}} = await github.repos.uploadAsset(upload); | ||
const { | ||
data: {browser_download_url: downloadUrl}, | ||
} = await github.repos.uploadAsset(upload); | ||
logger.log('Published file %s', downloadUrl); | ||
@@ -65,0 +69,0 @@ }) |
@@ -62,3 +62,5 @@ const {isUndefined, uniqBy, template, flatten} = require('lodash'); | ||
debug('create comment: %O', comment); | ||
const {data: {html_url: url}} = await github.issues.createComment(comment); | ||
const { | ||
data: {html_url: url}, | ||
} = await github.issues.createComment(comment); | ||
logger.log('Added comment to issue #%d: %s', issue.number, url); | ||
@@ -90,3 +92,5 @@ } else { | ||
debug('closing issue: %O', updateIssue); | ||
const {data: {html_url: url}} = await github.issues.edit(updateIssue); | ||
const { | ||
data: {html_url: url}, | ||
} = await github.issues.edit(updateIssue); | ||
logger.log('Closed issue #%d: %s.', issue.number, url); | ||
@@ -93,0 +97,0 @@ } catch (err) { |
@@ -74,9 +74,11 @@ const {isString, isPlainObject, isUndefined, isArray} = require('lodash'); | ||
errors.push(getError('EINVALIDGITHUBURL')); | ||
} | ||
if (githubToken) { | ||
} else if (githubToken) { | ||
const github = getClient({githubToken, githubUrl, githubApiPathPrefix}); | ||
try { | ||
const {data: {permissions: {push}}} = await github.repos.get({repo, owner}); | ||
const { | ||
data: { | ||
permissions: {push}, | ||
}, | ||
} = await github.repos.get({repo, owner}); | ||
if (!push) { | ||
@@ -94,5 +96,8 @@ errors.push(getError('EGHNOPERMISSION', {owner, repo})); | ||
} | ||
} else { | ||
} | ||
if (!githubToken) { | ||
errors.push(getError('ENOGHTOKEN', {owner, repo})); | ||
} | ||
if (errors.length > 0) { | ||
@@ -99,0 +104,0 @@ throw new AggregateError(errors); |
{ | ||
"name": "@semantic-release/github", | ||
"description": "Set of semantic-release plugins for publishing a GitHub release", | ||
"version": "4.2.15", | ||
"version": "4.2.16", | ||
"author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", | ||
@@ -46,3 +46,3 @@ "bugs": { | ||
"tempy": "^0.2.1", | ||
"xo": "^0.20.0" | ||
"xo": "^0.21.0" | ||
}, | ||
@@ -83,3 +83,4 @@ "engines": { | ||
"prettier": { | ||
"printWidth": 120 | ||
"printWidth": 120, | ||
"trailingComma": "es5" | ||
}, | ||
@@ -86,0 +87,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47994
652