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

@mapbox/github-release-tools

Package Overview
Dependencies
Maintainers
14
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/github-release-tools - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

bin/branch-permissions

3

package.json
{
"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 @@

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