Skip to content

Commit

Permalink
Added logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbokvad committed Sep 8, 2023
1 parent 779b34b commit cf0b264
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions src/Pentest/PentestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export class PentestService {

console.log('Pentest Date is set', pentestDate.date);

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

const octokit = github.getOctokit(token);
console.log('octoKit authenticated');
// const octokit = github.getOctokit(token);
// console.log('octoKit authenticated');

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

console.log('Going to get Pentest tickets from github boards');
// console.log('Going to get Pentest tickets from github boards');

// await octokit.rest.projects
// .createForRepo({
Expand All @@ -39,39 +39,39 @@ export class PentestService {
// core.warning('Error getting column!');
// console.log('Error: ', error);
// });
await octokit.rest.projects
.listForOrg({
org: owner,
})
.then(async (response) => {
console.log('Got the projects for org');
console.log(response.data);
})
.catch((error) => {
core.warning('Error getting projects for org!');
console.log('Error: ', error);
});
// await octokit.rest.projects
// .listForOrg({
// org: owner,
// })
// .then(async (response) => {
// console.log('Got the projects for org');
// console.log(response.data);
// })
// .catch((error) => {
// core.warning('Error getting projects for org!');
// console.log('Error: ', error);
// });

const customLabelIssues = await octokit.rest.issues
.listForRepo({
owner: owner,
repo: repo,
})
.then(async (response) => {
const issues = response.data;
console.log('Got the issues');
console.log('Number of issues: ', issues.length);
const customLabelIssues = issues.filter((issue) => {
console.log('issue', issue.title);
return issue.labels.some((label: any) => label.name === pentestDate.boardsTag);
});
console.log('customLabelIssues', customLabelIssues.length);
return customLabelIssues;
})
.catch((error) => {
core.warning('Error getting project for repo!');
console.log('Error: ', error);
});
// const customLabelIssues = await octokit.rest.issues
// .listForRepo({
// owner: owner,
// repo: repo,
// })
// .then(async (response) => {
// const issues = response.data;
// console.log('Got the issues');
// console.log('Number of issues: ', issues.length);
// const customLabelIssues = issues.filter((issue) => {
// console.log('issue', issue.title);
// return issue.labels.some((label: any) => label.name === pentestDate.boardsTag);
// });
// console.log('customLabelIssues', customLabelIssues.length);
// return customLabelIssues;
// })
// .catch((error) => {
// core.warning('Error getting project for repo!');
// console.log('Error: ', error);
// });

// await octokit.rest.projects
// .listCards({
Expand Down

0 comments on commit cf0b264

Please sign in to comment.