Skip to content

Commit

Permalink
test impl
Browse files Browse the repository at this point in the history
  • Loading branch information
salemxd committed Apr 17, 2024
1 parent 11a7ca8 commit 3dce5b3
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/identitiesInRepo/identitiesInRepoService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import { Octokit } from '@octokit/rest';

export class IdentitiesInRepoService {
public static async setIdentitiesInRepoFindings(): Promise<void> {
try {
console.log('--- Identities In Repo Control ---');
const { owner, repo }: { owner: string; repo: string } = github.context.repo;
const token: string = core.getInput('PAT-token');

const octokit: Octokit = new Octokit({
auth: token,
});

// https://www.npmjs.com/package/octokit#pagination
const iterator =

Check failure on line 17 in src/identitiesInRepo/identitiesInRepoService.ts

View workflow job for this annotation

GitHub Actions / build

Expected iterator to have a type annotation
octokit.paginate.iterator(octokit.repos.listContributors, {
owner: owner,
repo: repo,
per_page: 100
});

for await (const { data: page } of iterator) {
for (const user of page) {
console.log("---")
console.log(user.type)
}
}


} catch (error) {
core.warning('Failed to fetch identities for repo');
core.warning(error.message);
}
console.log();
}
}
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { CodeQualityService } from './codequalitytools/CodeQualityService';
import { SastService } from './sasttools/SastService';
import { ScaService } from './scatools/ScaService';
import { SecretScanningService } from './secretscanning/SecretScanningService';
import { IdentitiesInRepoService } from './identitiesInRepo/identitiesInRepoService'
/**
* The main function for the action.
* @returns {Promise<void>} Resolves when the action is complete.
Expand All @@ -24,6 +25,7 @@ export async function run(): Promise<void> {
await SecretScanningService.getStateOfExposedSecrets();

await BranchProtectionService.getStateOfBranchProtection();
await IdentitiesInRepoService.setIdentitiesInRepoFindings();

await PentestService.getStateOfPentest(cydigConfig.pentest);
await ThreatModelingService.getStateOfThreatModeling(cydigConfig.threatModeling);
Expand Down

0 comments on commit 3dce5b3

Please sign in to comment.