Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4e6a1a1
add: unit e2e test suite, ci workflow and coverage badge
cx-artur-ribeiro Oct 8, 2026
941e5e2
add: explanatory comment to write permissions
cx-artur-ribeiro Oct 8, 2026
ef40405
update: test coverage to match real use cases and known bug count
cx-artur-ribeiro Oct 8, 2026
4bbce2a
add: known-bug missing file
cx-artur-ribeiro Oct 8, 2026
87e3066
add: correct badge
cx-artur-ribeiro Oct 8, 2026
5574ee2
fix: input queries and bom params
cx-artur-ribeiro Oct 11, 2026
cb5d186
fix: only enable boolean switches when the input is "true"
cx-artur-ribeiro Oct 11, 2026
335aef2
fix: escape pipes and all newlines in query table cells
cx-artur-ribeiro Oct 11, 2026
bcb7a03
fix: skip the PR comment when the event is not a pull request
cx-artur-ribeiro Oct 11, 2026
95d07bb
fix: post the summary without the queries table when the comment is t…
cx-artur-ribeiro Oct 11, 2026
4fa913b
test: make the fake kics write results world-readable like KICS v2.1.20
cx-artur-ribeiro Oct 11, 2026
ed22758
fix: keep a scan path containing spaces as a single argument
cx-artur-ribeiro Oct 11, 2026
27eb212
fix: keep path-valued inputs containing spaces as single arguments
cx-artur-ribeiro Oct 11, 2026
c15cd6c
fix: remove the results.json KICS wrote into the workspace when json …
cx-artur-ribeiro Oct 11, 2026
d8eecb5
fix: honor the type input as an alias of platform_type
cx-artur-ribeiro Oct 11, 2026
acee6b2
docs: set ignore-on-exit in the config file SARIF example
cx-artur-ribeiro Oct 11, 2026
a3c3d35
docs: set ignore-on-exit in the config file SARIF example
cx-artur-ribeiro Oct 11, 2026
c7405ee
fix: dead code removal
cx-artur-ribeiro Oct 16, 2026
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ jobs:
{
"exclude-categories": "Encryption",
"exclude-paths": "terraform/gcp/big_data.tf,terraform/gcp/gcs.tf",
"ignore-on-exit": "results",
"log-file": true,
"minimal-ui": false,
"no-color": false,
Expand Down
10 changes: 7 additions & 3 deletions src/commenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,17 @@ async function postPRComment(results, repo, prNumber, octokit, commentWithQuerie
message = createComment(results) + "_The queries table was omitted: it exceeds the GitHub comment size limit._\n";
}

const comments = await octokit.paginate(octokit.rest.issues.listComments, {
const {data: comments} = await octokit.rest.issues.listComments({
...repo,
issue_number: prNumber,
per_page: 100,
});

const comment = comments.find((comment) => comment.body?.startsWith("![kics-logo]("));
const comment = comments.find((comment) => {
return (
comment.user.login === "github-actions[bot]" &&
comment.body.startsWith("![kics-logo](")
);
});

if (comment) {
await octokit.rest.issues.updateComment({
Expand Down
5 changes: 1 addition & 4 deletions test/e2e/action-contract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const assert = require('node:assert/strict')
const fs = require('node:fs')
const path = require('node:path')
const { ROOT, loadManifest, runnerInputEnv } = require('../helpers/action-manifest')
const { knownBug } = require('../helpers/known-bug')

const { inputs, env } = loadManifest()
const read = (file) => fs.readFileSync(path.join(ROOT, file), 'utf8')
Expand All @@ -16,7 +15,6 @@ const consumed = new Set([
])
consumed.delete('INPUT_PARAM') // entrypoint.sh's own "-p <path>" variable, not an action input


test('action.yml parsing assumptions hold', async (t) => {
await t.test('declares inputs and the runs.env mappings the tests rely on', () => {
assert.ok(Object.keys(inputs).length > 20, 'inputs section parsed')
Expand All @@ -43,8 +41,7 @@ test('every declared input is used by the code', async (t) => {
const viaEnvMapping = new Set(Object.entries(env).filter(([key]) => consumed.has(key)).map(([, input]) => input))
for (const name of Object.keys(inputs)) {
const used = consumed.has(`INPUT_${name.toUpperCase()}`) || viaEnvMapping.has(name)
const options = name in KNOWN_UNUSED_INPUTS ? knownBug(KNOWN_UNUSED_INPUTS[name]) : {}
await t.test(name, options, () => assert.ok(used, `input "${name}" is declared but never read`))
await t.test(name, () => assert.ok(used, `input "${name}" is declared but never read`))
}
})

Expand Down
4 changes: 1 addition & 3 deletions test/e2e/repository-contract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const test = require('node:test')
const assert = require('node:assert/strict')
const fs = require('node:fs')
const path = require('node:path')
const { knownBug } = require('../helpers/known-bug')
const { ROOT, loadManifest } = require('../helpers/action-manifest')

const read = (file) => fs.readFileSync(path.join(ROOT, file), 'utf8')
Expand Down Expand Up @@ -54,7 +53,6 @@ test('README', async (t) => {
await t.test('has SARIF upload examples', () => assert.ok(sarifExamples.length > 0))

for (const [i, block] of sarifExamples.entries()) {
const options = block.includes('config_path') ? knownBug('the config file example sets neither ignore_on_exit nor ignore-on-exit, so the job fails before the SARIF upload (#76)') : {}
await t.test(`SARIF upload example ${i + 1} does not fail before the upload`, options, () => assert.match(block, /ignore[_-]on[_-]exit/))
await t.test(`SARIF upload example ${i + 1} does not fail before the upload`, () => assert.match(block, /ignore[_-]on[_-]exit/))
}
})
Loading