Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: small chore changes (explained in pr description) #20

Merged
merged 1 commit into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function getActionConfig() {
const dockerPassword = core.getInput('docker-password');

const token = core.getInput('github-token');
const reportJobSummary = core.getBooleanInput('report-job-summary');

const logLevel = core.getInput('log-level');
const preventionMode = core.getBooleanInput('prevent');
Expand All @@ -20,9 +21,7 @@ function getActionConfig() {
const clientId = core.getInput('client-id');
const secret = core.getInput('secret');

const reportJobSummary = core.getBooleanInput('report-job-summary');
const reportProcessTree = core.getBooleanInput('report-process-tree');
const reportArtifactLog = core.getBooleanInput('report-artifact-log');
const slackWebhookEndpoint = core.getInput('slack-webhook-endpoint');
const featureGates = core.getMultilineInput('feature-gates');

Expand All @@ -35,6 +34,7 @@ function getActionConfig() {
},
github: {
token: token,
jobSummary: reportJobSummary,
},
cimon: {
logLevel: logLevel,
Expand All @@ -47,9 +47,7 @@ function getActionConfig() {
featureGates: featureGates,
},
report: {
jobSummary: reportJobSummary,
processTree: reportProcessTree,
artifactLog: reportArtifactLog,
slackWebhookEndpoint: slackWebhookEndpoint,
},
};
Expand Down Expand Up @@ -103,11 +101,9 @@ async function run(config) {

if (config.cimon.allowedHosts !== "") {
args.push('--env', `CIMON_ALLOWED_HOSTS=${config.cimon.allowedHosts}`);
// TODO Remove the CIMON_ALLOWED_DOMAIN_NAMES setting when we upgrade the default image used by this action.
args.push('--env', `CIMON_ALLOWED_DOMAIN_NAMES=${config.cimon.allowedHosts}`);
}

if (config.report.jobSummary) {
if (config.github.jobSummary) {
args.push('--env', 'CIMON_REPORT_GITHUB_JOB_SUMMARY=1');
}

Expand Down Expand Up @@ -135,7 +131,7 @@ async function run(config) {
args.push('--env', `CIMON_FEATURE_GATES=${config.cimon.featureGates}`);
}


args.push(config.docker.image);

const exitCode = await exec.exec('docker', args, {
Expand Down
3 changes: 2 additions & 1 deletion src/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ try {
await run(getActionConfig());
} catch (error) {
const failOnError = core.getBooleanInput('fail-on-error');
const reportJobSummary = core.getBooleanInput('report-job-summary');
const log = error.message;
if (failOnError) {
core.setFailed(log);
} else {
} else if (reportJobSummary) {
await core.summary
.addHeading('Cimon Security Report - Failure')
.addRaw('Cimon encountered an error and was shut down due to the "fail-on-error=false" flag. Details of the error are below:')
Expand Down