From a8887ae37c156f408b6e394e93f2ab63238fe100 Mon Sep 17 00:00:00 2001 From: Artur Ribeiro <153724638+cx-artur-ribeiro@users.noreply.github.com> Date: Sun, 11 Oct 2026 12:43:50 +0100 Subject: [PATCH 1/2] fix: honor the type input as an alias of platform_type --- entrypoint.sh | 1 + test/e2e/action-contract.test.js | 2 +- test/e2e/entrypoint.test.js | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 10e6305..b8e6be2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,6 +24,7 @@ set -- [[ ! -z "$INPUT_EXCLUDE_QUERIES" ]] && EXCLUDE_QUERIES_PARAM="--exclude-queries $INPUT_EXCLUDE_QUERIES" [[ ! -z "$INPUT_EXCLUDE_CATEGORIES" ]] && EXCLUDE_CATEGORIES_PARAM="--exclude-categories $INPUT_EXCLUDE_CATEGORIES" [[ "$INPUT_EXCLUDE_GITIGNORE" == "true" ]] && EXCLUDE_GITIGNORE="--exclude-gitignore" +INPUT_PLATFORM_TYPE="${INPUT_PLATFORM_TYPE:-$INPUT_TYPE}" [[ ! -z "$INPUT_PLATFORM_TYPE" ]] && PLATFORM_TYPE_PARAM="--type $INPUT_PLATFORM_TYPE" [[ ! -z "$INPUT_FAIL_ON" ]] && FAIL_ON_PARAM="--fail-on $INPUT_FAIL_ON" [[ ! -z "$INPUT_TIMEOUT" ]] && TIMEOUT_PARAM="--timeout $INPUT_TIMEOUT" diff --git a/test/e2e/action-contract.test.js b/test/e2e/action-contract.test.js index 910ef31..99bf25a 100644 --- a/test/e2e/action-contract.test.js +++ b/test/e2e/action-contract.test.js @@ -16,7 +16,7 @@ const consumed = new Set([ ]) consumed.delete('INPUT_PARAM') // entrypoint.sh's own "-p " variable, not an action input -const KNOWN_UNUSED_INPUTS = { type: 'declared in action.yml but entrypoint.sh only reads platform_type, so `type:` is silently ignored' } +const KNOWN_UNUSED_INPUTS = {} test('action.yml parsing assumptions hold', async (t) => { await t.test('declares inputs and the runs.env mappings the tests rely on', () => { diff --git a/test/e2e/entrypoint.test.js b/test/e2e/entrypoint.test.js index a58e547..0e12016 100644 --- a/test/e2e/entrypoint.test.js +++ b/test/e2e/entrypoint.test.js @@ -63,6 +63,7 @@ test('inputs mapped to KICS flags', async (t) => { ['exclude_queries', '11111111-2222-3333-4444-555555555555', '--exclude-queries'], ['exclude_categories', 'Observability,Backup', '--exclude-categories'], ['platform_type', 'Terraform,Dockerfile', '--type'], + ['type', 'Ansible,Dockerfile', '--type'], ['fail_on', 'high,medium', '--fail-on'], ['timeout', '60', '--timeout'], ['profiling', 'CPU', '--profiling'], @@ -79,6 +80,11 @@ test('inputs mapped to KICS flags', async (t) => { }) } + await t.test('platform_type wins when type is set as well', async (t) => { + const run = await runEntrypoint(t, { inputs: { platform_type: 'Terraform', type: 'Ansible' } }) + assert.equal(flagValue(run.args, '--type'), 'Terraform') + }) + const withSpaces = [ ['payload_path', 'my dir/payload file.json', '-d'], ['config_path', 'my dir/kics config.json', '--config'], From cfc8c9b1d785a3e75b584b4f4e92c2defe9d3d6f Mon Sep 17 00:00:00 2001 From: Artur Ribeiro <153724638+cx-artur-ribeiro@users.noreply.github.com> Date: Fri, 16 Oct 2026 12:37:41 +0100 Subject: [PATCH 2/2] Update test/e2e/action-contract.test.js Co-authored-by: Miguel da Silva <100352574+cx-miguel-dasilva@users.noreply.github.com> --- test/e2e/action-contract.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/action-contract.test.js b/test/e2e/action-contract.test.js index 99bf25a..d607ec1 100644 --- a/test/e2e/action-contract.test.js +++ b/test/e2e/action-contract.test.js @@ -16,7 +16,6 @@ const consumed = new Set([ ]) consumed.delete('INPUT_PARAM') // entrypoint.sh's own "-p " variable, not an action input -const KNOWN_UNUSED_INPUTS = {} test('action.yml parsing assumptions hold', async (t) => { await t.test('declares inputs and the runs.env mappings the tests rely on', () => {