Skip to content

Commit

Permalink
Fixed json path
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbokvad committed Sep 7, 2023
1 parent ddabc29 commit 2fd9c61
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
38 changes: 27 additions & 11 deletions src/Pentest/PentestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,36 @@ export class PentestService {
}
core.setOutput("pentestDate", pentestDate.date);



// const token = core.getInput('repo-token');
// console.log("Got the token");

// const octokit = github.getOctokit(token);
// console.log("octoKit authenticated");
const token = core.getInput('repo-token');
console.log("Got the token");

// const { owner, repo } = github.context.repo;
// console.log(`Owner: ${owner}`);
// console.log(`Repo: ${repo}`);

// console.log("Going to get branch protection");
// await octokit.rest.repos.getBranchProtection({
const octokit = github.getOctokit(token);
console.log("octoKit authenticated");

const { owner, repo } = github.context.repo;
console.log(`Owner: ${owner}`);
console.log(`Repo: ${repo}`);

console.log("Going to get branch protection");
await octokit.rest.projects.listCards({
owner: owner,
repo: repo,
column_id: 123456789,

}).then((response) => {
console.log("Got the cards");
const projectCards = response.data;
const customLabelCards = projectCards.filter((card) => {
return card.note?.includes(pentestDate.boardsTag);
});


}).catch((error) => {
core.warning("Error getting cards!");
core.warning("Error: ", error.message);
});
// owner: owner,
// repo: repo,
// branch: 'main',
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { PentestService } from './Pentest/PentestService';
*/
export async function run(): Promise<void> {
try {
const cydigConfig: CyDigConfig = getContentOfFile("./cydigconfig.json");
const cydigConfig: CyDigConfig = getContentOfFile("cydigconfig.json");
await PentestService.getStateOfPentest(cydigConfig.pentest);

await BranchProtectionService.getStateOfBranchProtection();


Expand Down

0 comments on commit 2fd9c61

Please sign in to comment.