Skip to content

Commit 9df07df

Browse files
Merge pull request #7 from Contrast-Security-OSS/PRODSEC-475
Prodsec 475 - Logs
2 parents b0cb5a4 + 1909c15 commit 9df07df

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

lib/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39050,9 +39050,12 @@ function run(context) {
3905039050
actionPolicyList.forEach((item) => {
3905139051
console.log(item.toString());
3905239052
});
39053+
console.log("\nREADING WORKFLOW FILES");
3905339054
workflowFilePaths.forEach((wf) => {
39055+
console.log(line);
3905439056
let workflow = { filePath: wf, actions: Array() };
3905539057
workflowFiles.push(workflow);
39058+
console.log("\nReading:" + workflow.filePath);
3905639059
try {
3905739060
let yaml = js_yaml_1.default.load(fs_1.default.readFileSync(workflow.filePath, "utf-8"));
3905839061
let actionStrings = getPropertyValues(yaml, "uses");
@@ -39103,12 +39106,12 @@ function run(context) {
3910339106
actionViolations.push(violation);
3910439107
}
3910539108
else {
39106-
console.log("\nNo violations detected");
39109+
console.log("\n ✅ No violations detected");
3910739110
}
3910839111
});
3910939112
if (actionViolations.length > 0) {
3911039113
core.setOutput("violations", actionViolations);
39111-
console.log("\n!!! ACTION POLICY VIOLATIONS DETECTED !!!");
39114+
console.log("\nACTION POLICY VIOLATIONS DETECTED ");
3911239115
console.log(line);
3911339116
actionViolations.forEach((workflow) => {
3911439117
console.log(`Workflow: ${workflow.filePath}`);
@@ -39118,11 +39121,11 @@ function run(context) {
3911839121
console.log();
3911939122
});
3912039123
if (failIfViolations) {
39121-
core.setFailed("!!! ACTION POLICY VIOLATIONS DETECTED !!!");
39124+
core.setFailed("ACTION POLICY VIOLATIONS DETECTED ");
3912239125
}
3912339126
}
3912439127
else {
39125-
console.log("\nAll workflow files contain actions that conform to the policy provided.");
39128+
console.log("\n ✅ All workflow files contain actions that conform to the policy provided.");
3912639129
}
3912739130
}
3912839131
catch (error) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "actionbot",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"private": true,
55
"description": "Github Action Policy Checker as a Github Action",
66
"main": "lib/index.js",

src/main.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,12 @@ async function run(context: typeof github.context): Promise<void> {
202202
console.log(item.toString());
203203
});
204204

205+
console.log("\nREADING WORKFLOW FILES");
205206
workflowFilePaths.forEach((wf) => {
207+
console.log(line);
206208
let workflow: Workflow = { filePath: wf, actions: Array<Action>() };
207209
workflowFiles.push(workflow);
208-
210+
console.log("\nReading:" + workflow.filePath);
209211
try {
210212
let yaml: any = yamlParse.load(
211213
fs.readFileSync(workflow.filePath, "utf-8"),
@@ -265,13 +267,13 @@ async function run(context: typeof github.context): Promise<void> {
265267
if (violation.actions.length > 0) {
266268
actionViolations.push(violation);
267269
} else {
268-
console.log("\nNo violations detected");
270+
console.log("\n ✅ No violations detected");
269271
}
270272
});
271273

272274
if (actionViolations.length > 0) {
273275
core.setOutput("violations", actionViolations);
274-
console.log("\n!!! ACTION POLICY VIOLATIONS DETECTED !!!");
276+
console.log("\nACTION POLICY VIOLATIONS DETECTED ");
275277
console.log(line);
276278

277279
actionViolations.forEach((workflow) => {
@@ -285,11 +287,11 @@ async function run(context: typeof github.context): Promise<void> {
285287
});
286288

287289
if (failIfViolations) {
288-
core.setFailed("!!! ACTION POLICY VIOLATIONS DETECTED !!!");
290+
core.setFailed("ACTION POLICY VIOLATIONS DETECTED ");
289291
}
290292
} else {
291293
console.log(
292-
"\nAll workflow files contain actions that conform to the policy provided.",
294+
"\n ✅ All workflow files contain actions that conform to the policy provided.",
293295
);
294296
}
295297
} catch (error: unknown) {

0 commit comments

Comments
 (0)