Skip to content
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
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion test/e2e/action-contract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const consumed = new Set([
])
consumed.delete('INPUT_PARAM') // entrypoint.sh's own "-p <path>" 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' }

test('action.yml parsing assumptions hold', async (t) => {
await t.test('declares inputs and the runs.env mappings the tests rely on', () => {
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/entrypoint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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'],
Expand Down
Loading