Skip to content

Commit 0b6ff3e

Browse files
authored
Added report-artifact-log flag. (#15)
If set to false, logs will not be uploaded as job artifact.
1 parent 95f072f commit 0b6ff3e

7 files changed

Lines changed: 35 additions & 2 deletions

File tree

.github/workflows/verify-pr.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,25 @@ jobs:
4949
client-id: ${{ secrets.CIMON_CLIENT_ID }}
5050
secret: ${{ secrets.CIMON_SECRET }}
5151
allowed-hosts: this,would,^$#yield,error
52+
53+
verify-no-artifact:
54+
runs-on: ubuntu-22.04
55+
steps:
56+
- name: Checkout Code
57+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
58+
59+
- name: Run Cimon
60+
uses: ./
61+
with:
62+
client-id: ${{ secrets.CIMON_CLIENT_ID }}
63+
secret: ${{ secrets.CIMON_SECRET }}
64+
prevent: true
65+
report-artifact-log: false
66+
allowed-hosts: >
67+
cycode.com
68+
69+
- name: Test
70+
run: |
71+
curl -I https://cycode.com
72+
curl -I https://github.com
73+

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The action supports the following parameters:
3333
| `github-token` | `${{ github.token }}` | GitHub token (used to overcome GitHub rate limiting) |
3434
| `report-job-summary` | `true` | Report results through job summary output |
3535
| `report-process-tree` | `false` | Enable to report the process tree |
36+
| `report-artifact-log` | `true` | Report logs through job artifact |
3637
| `slack-webhook-endpoint` | | Slack webhook endpoint to report security events |
3738
| `apply-fs-events` | `false` | Enable processing filesystem events and display them in the process tree report |
3839
| `docker-image` | `docker.io/cycodelabs/cimon:v0.4.0` | Docker image reference |

action.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
description: Enable to report the process tree
3030
required: false
3131
default: "false"
32+
report-artifact-log:
33+
description: Report logs through job artifact
34+
required: false
35+
default: "true"
3236
slack-webhook-endpoint:
3337
description: Slack webhook endpoint to report security events
3438
required: false

dist/main/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4138,6 +4138,7 @@ function getActionConfig() {
41384138

41394139
const reportJobSummary = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('report-job-summary');
41404140
const reportProcessTree = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('report-process-tree');
4141+
const reportArtifactLog = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('report-artifact-log');
41414142
const slackWebhookEndpoint = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('slack-webhook-endpoint');
41424143
const featureGates = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput('feature-gates');
41434144

@@ -4164,6 +4165,7 @@ function getActionConfig() {
41644165
report: {
41654166
jobSummary: reportJobSummary,
41664167
processTree: reportProcessTree,
4168+
artifactLog: reportArtifactLog,
41674169
slackWebhookEndpoint: slackWebhookEndpoint,
41684170
},
41694171
};
@@ -4249,6 +4251,7 @@ async function run(config) {
42494251
args.push('--env', `CIMON_FEATURE_GATES=${config.cimon.featureGates}`);
42504252
}
42514253

4254+
42524255
args.push(config.docker.image);
42534256

42544257
const exitCode = await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec('docker', args, {

dist/post/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10967,7 +10967,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
1096710967
function getActionConfig() {
1096810968
return {
1096910969
job: process.env.GITHUB_JOB,
10970-
createArtifact: true,
10970+
createArtifact: _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput('report-artifact-log'),
1097110971
};
1097210972
}
1097310973

src/main/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function getActionConfig() {
2222

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

@@ -48,6 +49,7 @@ function getActionConfig() {
4849
report: {
4950
jobSummary: reportJobSummary,
5051
processTree: reportProcessTree,
52+
artifactLog: reportArtifactLog,
5153
slackWebhookEndpoint: slackWebhookEndpoint,
5254
},
5355
};
@@ -133,6 +135,7 @@ async function run(config) {
133135
args.push('--env', `CIMON_FEATURE_GATES=${config.cimon.featureGates}`);
134136
}
135137

138+
136139
args.push(config.docker.image);
137140

138141
const exitCode = await exec.exec('docker', args, {

src/post/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import poll from "../poll/poll.js";
77
function getActionConfig() {
88
return {
99
job: process.env.GITHUB_JOB,
10-
createArtifact: true,
10+
createArtifact: core.getBooleanInput('report-artifact-log'),
1111
};
1212
}
1313

0 commit comments

Comments
 (0)