Skip to content

Commit

Permalink
feat: add main to default protected branches
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasbueschel authored May 6, 2022
1 parent 7250acc commit 5fecfe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { exec, which } = require('shelljs')
const { exit } = process
const { log } = console

const PROTECTED_BRANCHES = ['master', 'develop']
const PROTECTED_BRANCHES = ['master', 'main', 'develop']

function getPullRequestUrl(remote, currentBranch, stderr) {
const address = GitUrlParse(remote)
Expand Down Expand Up @@ -48,7 +48,7 @@ async function gitPushPR(options) {

// 3. Stop if currently on protected branch (optional)
if (!options.allowAll && PROTECTED_BRANCHES.includes(currentBranch)) {
log(chalk.red('[git-push-pr]: cannot push protected (master|develop) branch'))
log(chalk.red('[git-push-pr]: cannot push protected (master|main|develop) branch'))
exit(1)
}

Expand Down

0 comments on commit 5fecfe5

Please # to comment.