Skip to content

Commit

Permalink
Added error handeling for pentest and threatmodeling
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbokvad committed Sep 8, 2023
1 parent 860c1da commit 50b2dc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import * as github from '@actions/github';
import { BranchProtectionService } from './branchprotection/BranchProtectionService';
import { CyDigConfig } from './types/CyDigConfig';
import { getContentOfFile } from './helpfunctions/JsonService';
import { PentestService } from './Pentest/PentestService';
import { ThreatModelingDate } from './threatmodelingdate/ThreatModelingDate';
import { PentestService } from './pentest/PentestService';
import { ThreatModelingService } from './threatmodeling/ThreatModelingService';
/**
* The main function for the action.
* @returns {Promise<void>} Resolves when the action is complete.
*/
export async function run(): Promise<void> {
try {
const cydigConfig: CyDigConfig = getContentOfFile("src/cydigconfig.json");
const cydigConfig: CyDigConfig = getContentOfFile('src/cydigconfig.json');
await BranchProtectionService.getStateOfBranchProtection();
await PentestService.getStateOfPentest(cydigConfig.pentest);
await ThreatModelingDate.getStateOfThreatModeling(cydigConfig.threatModeling);
await PentestService.getStateOfPentest(cydigConfig.pentest);
await ThreatModelingService.getStateOfThreatModeling(cydigConfig.threatModeling);


// await ThreatModelingService.getStateOfThreatModeling(cydigConfig.threatModeling);
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
export class ThreatModelingDate{
export class ThreatModelingService{

public static async getStateOfThreatModeling(threatModelingDate: {
date: string;
Expand Down

0 comments on commit 50b2dc3

Please sign in to comment.