Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@signalk/github-create-release

Package Overview
Dependencies
Maintainers
6
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@signalk/github-create-release - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

64

bin/index.js

@@ -36,38 +36,44 @@ #!/usr/bin/env node

async function main() {
const tags = await octokit.repos.listTags({owner, repo, per_page:!updateAll ? 2 : 100, pages:1 })
for ( let i = 0; i < tags.data.length; i++ ) {
const tag = tags.data[i]
if ( tag.name != 'latest' && i != 0 ) {
const prev = tags.data[i-1].name
const commits = await octokit.repos.compareCommits({owner, repo, base:tag.name, head:prev})
try
{
const tags = await octokit.repos.listTags({owner, repo, per_page:!updateAll ? 2 : 100, pages:1 })
const donePRs = []
let body = ''
for ( let j = 0; j < commits.data.commits.length; j++ ) {
const commit = commits.data.commits[j]
const prs = await octokit.search.issuesAndPullRequests({ q: `type:pr repo:${owner}/${repo} ${commit.sha}` })
if ( prs.data.items.length > 0 ) {
const pr = prs.data.items[0]
if ( donePRs.indexOf(pr.number) == -1 ) {
donePRs.push(pr.number)
body += `+ [#${pr.number}](${pr.pull_request.url}) ${pr.title} (@${pr.user.login})\n`
for ( let i = 0; i < tags.data.length; i++ ) {
const tag = tags.data[i]
if ( tag.name != 'latest' && i != 0 ) {
const prev = tags.data[i-1].name
const commits = await octokit.repos.compareCommits({owner, repo, base:tag.name, head:prev})
const donePRs = []
let body = ''
for ( let j = 0; j < commits.data.commits.length; j++ ) {
const commit = commits.data.commits[j]
const prs = await octokit.search.issuesAndPullRequests({ q: `type:pr repo:${owner}/${repo} ${commit.sha}` })
if ( prs.data.items.length > 0 ) {
const pr = prs.data.items[0]
if ( donePRs.indexOf(pr.number) == -1 ) {
donePRs.push(pr.number)
body += `+ [#${pr.number}](${pr.pull_request.url}) ${pr.title} (@${pr.user.login})\n`
}
}
}
}
const baseUrl = npmBaseUrl ? npmBaseUrl : `https://www.npmjs.com/package/@${owner}/${repo}`
body += `\n\n[This version in npm](${baseUrl}/v/${prev.slice(1)})`
try {
await octokit.repos.createRelease({owner, repo, tag_name: prev, body:body})
} catch ( e ) {
const release = await octokit.repos.getReleaseByTag({owner, repo, tag:prev})
await octokit.repos.updateRelease({owner, repo, release_id: release.data.id, prev, body:body})
const baseUrl = npmBaseUrl ? npmBaseUrl : `https://www.npmjs.com/package/@${owner}/${repo}`
body += `\n\n[This version in npm](${baseUrl}/v/${prev.slice(1)})`
try {
await octokit.repos.createRelease({owner, repo, tag_name: prev, body:body})
} catch ( e ) {
const release = await octokit.repos.getReleaseByTag({owner, repo, tag:prev})
await octokit.repos.updateRelease({owner, repo, release_id: release.data.id, prev, body:body})
}
console.log(`created or updated ${prev}`)
if ( !updateAll ) {
break
}
}
console.log(`created or updated ${prev}`)
if ( !updateAll ) {
break
}
}
} catch ( e ) {
console.error(e)
process.exit(1)
}

@@ -74,0 +80,0 @@ }

{
"name": "@signalk/github-create-release",
"version": "1.0.0",
"version": "1.0.1",
"description": "Create a GitHub Release Using Pull Requests",

@@ -5,0 +5,0 @@ "main": "index.js",

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