Skip to content

Commit

Permalink
refactor: destructured opts
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt committed Mar 15, 2022
1 parent 5294d1a commit a44d3c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/drivers/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ class Github {
}

/**
* @param {string} branch
* @param {{ branch: string }} opts
* @returns {Promise<boolean>}
*/
async isProtected(branch) {
async isProtected({ branch }) {
const octo = octokit(this.token, this.repo);
const { owner, repo } = this.ownerRepo();
try {
Expand Down Expand Up @@ -394,7 +394,7 @@ class Github {
const { owner, repo } = this.ownerRepo();
const settingsUrl = `https://github.com/${owner}/${repo}/settings`;

const isProtected = await this.isProtected(base);
const isProtected = await this.isProtected({ branch: base });
if (!isProtected) {
throw new Error(
`Enabling Auto-Merge failed. Please set up branch protection and add "required status checks" for branch '${base}': ${settingsUrl}/branches`
Expand Down

0 comments on commit a44d3c1

Please sign in to comment.