@mapbox/github-release-tools
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "@mapbox/github-release-tools", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"bin": { | ||
"backport": "bin/backport", | ||
"branch-permissions": "bin/branch-permissions", | ||
"changelog-draft": "bin/changelog-draft" | ||
@@ -7,0 +8,0 @@ }, |
@@ -70,1 +70,18 @@ # github-release-tools | ||
``` | ||
## `branch-permissions` | ||
``` | ||
branch-permissions <target> [source] | ||
Copies branch protection permissions from one branch to another. | ||
Positionals: | ||
target Branch to copy permissions to [string] | ||
source Branch to copy permissions from [string] [default: "master"] | ||
Options: | ||
--version Show version number [boolean] | ||
--help Show help [boolean] | ||
``` |
@@ -16,7 +16,9 @@ const parse = require('parse-github-url'); | ||
const prPatch = (await octokit.pullRequests.get({owner, repo, number, headers: {accept: 'application/vnd.github.v3.patch'}})).data; | ||
const prSlug = branch.replace(/^release-/, ''); | ||
const prBranch = `backport-${prSlug}-${number}-${prData.head.ref}`; | ||
execSync(`git branch --no-track backport-${number} origin/${branch}`); | ||
execSync(`git checkout backport-${number}`); | ||
execSync(`git branch --no-track ${prBranch} origin/${branch}`); | ||
execSync(`git checkout ${prBranch}`); | ||
execSync(`git am`, {input: prPatch}); | ||
execSync(`git push origin --set-upstream backport-${number}`); | ||
execSync(`git push origin --set-upstream ${prBranch}`); | ||
@@ -26,6 +28,6 @@ const result = (await octokit.pullRequests.create({ | ||
repo, | ||
title: `${branch} backport: ${prData.title}`, | ||
head: `backport-${number}`, | ||
title: `${prSlug} backport: ${prData.title}`, | ||
head: prBranch, | ||
base: branch, | ||
body: `Backports #${number} to ${branch}\n----\n${prData.body}` | ||
body: `Backports #${number} to [\`${branch}\`](https://github.com/${owner}/${repo}/tree/${branch})\n\n---\n\n${prData.body}` | ||
})).data; | ||
@@ -32,0 +34,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
160163
20
429
87
3
3