Skip to content

Commit

Permalink
refactor project
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbokvad committed Sep 28, 2023
1 parent f74b060 commit 76459ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 227 deletions.
206 changes: 3 additions & 203 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@octokit/action": "^6.0.6",
"@vercel/ncc": "^0.36.1",
"joi": "^17.10.1"
},
Expand Down
24 changes: 1 addition & 23 deletions src/branchprotection/BranchProtectionService.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as core from '@actions/core';
import * as github from '@actions/github';
import { Octokit } from '@octokit/action';
export class BranchProtectionService {
public static async getStateOfBranchProtection(): Promise<void> {
console.log('\n Running branch protection control');

// const octokit: Octokit = new Octokit();
const { owner, repo }: { owner: string; repo: string } = github.context.repo;
// octokit.repos
// .getBranchProtection({
// owner: owner,
// repo: repo,
// branch: 'main',
// })
// .then((response: any) => {
// console.log(
// 'Branch protection is enabled, and reviewers needed are:',
// response.data.required_approving_review_count
// );
// console.log(response.data);
// })
// .catch((error: any) => {
// console.log('Branch protections is not enabled for repository: ' + repo);
// console.log('Error:', error?.message);
// });

//numberOfReviewers > 0, if state of branch protection changes
const numberOfReviewers: number = 0;

const token: string = core.getInput('github-token');
const token: string = core.getInput('PAT-token');
const octokit: any = github.getOctokit(token);

await octokit.rest.repos
Expand Down

0 comments on commit 76459ca

Please sign in to comment.