Socket
Socket
Sign inDemoInstall

@semantic-release/github

Package Overview
Dependencies
Maintainers
4
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semantic-release/github - npm Package Compare versions

Comparing version 4.2.8 to 4.2.9

31

lib/success.js

@@ -1,3 +0,4 @@

const {isUndefined, uniqBy, template} = require('lodash');
const {isUndefined, uniqBy, template, flatten} = require('lodash');
const parseGithubUrl = require('parse-github-url');
const pFilter = require('p-filter');
const AggregateError = require('aggregate-error');

@@ -20,12 +21,12 @@ const issueParser = require('issue-parser')('github');

const releaseInfos = releases.filter(release => Boolean(release.name));
const shas = commits.map(commit => commit.hash);
const prs = [].concat(
...(await Promise.all(
getSearchQueries(`repo:${owner}/${repo}+type:pr`, commits.map(commit => commit.hash)).map(async q => {
const {data: {items}} = await github.search.issues({q});
return items;
})
))
const searchQueries = getSearchQueries(`repo:${owner}/${repo}+type:pr+is:merged`, shas).map(
async q => (await github.search.issues({q})).data.items
);
const prs = await pFilter(uniqBy(flatten(await Promise.all(searchQueries)), 'number'), async ({number}) =>
(await github.pullRequests.getCommits({owner, repo, number})).data.find(({sha}) => shas.includes(sha))
);
debug('found pull requests: %O', prs.map(pr => pr.number));

@@ -54,6 +55,12 @@

try {
const comment = {owner, repo, number: issue.number, body};
debug('create comment: %O', comment);
const {data: {html_url: url}} = await github.issues.createComment(comment);
logger.log('Added comment to issue #%d: %s', issue.number, url);
const {data: {state}} = await github.issues.get({owner, repo, number: issue.number});
if (state === 'closed') {
const comment = {owner, repo, number: issue.number, body};
debug('create comment: %O', comment);
const {data: {html_url: url}} = await github.issues.createComment(comment);
logger.log('Added comment to issue #%d: %s', issue.number, url);
} else {
logger.log("Skip comment on issue #%d as it's open: %s", issue.number);
}
} catch (err) {

@@ -60,0 +67,0 @@ if (err.code === 404) {

{
"name": "@semantic-release/github",
"description": "Set of semantic-release plugins for publishing a GitHub release",
"version": "4.2.8",
"version": "4.2.9",
"author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)",

@@ -29,2 +29,3 @@ "bugs": {

"mime": "^2.0.3",
"p-filter": "^1.0.0",
"p-retry": "^1.0.0",

@@ -31,0 +32,0 @@ "parse-github-url": "^1.0.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc