Skip to content

feat: add output_name input to map KICS --output-name CLI option - #154

Merged
cx-artur-ribeiro merged 3 commits into
Checkmarx:masterfrom
rasta-rocket:add_output_name
Oct 16, 2026
Merged

cx-artur-ribeiro merged 3 commits into
Checkmarx:masterfrom
rasta-rocket:add_output_name

Conversation

@rasta-rocket

@rasta-rocket rasta-rocket commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the missing output_name input to the GitHub Action, mapping it to the
KICS CLI --output-name flag. This allows users to customize the name of the
results output file instead of relying on the default.

Changes

  • Defined output_name input in action.yml (grouped with other output-related inputs)
  • Passed it as an arg to the Docker container in action.yml
  • Mapped INPUT_OUTPUT_NAME to --output-name in entrypoint.sh
  • Added the flag to the kics scan command
  • Updated entrypoint.sh to use the custom filename when resolving the
    copy path (CP_PATH) instead of hardcoding results.json
  • Updated processOutputPath() in src/main.js to build the JSON results
    file path using the custom name, so that post-scan features (annotations,
    PR comments, job summary) read the correct file

@rasta-rocket
rasta-rocket requested a review from a team as a code owner April 17, 2026 11:52
@rasta-rocket

Copy link
Copy Markdown
Contributor Author

Not sure what is the process here
So just in case this is not forgotten

ping @cx-bruno-silva @cx-miguel-dasilva

@cx-artur-ribeiro cx-artur-ribeiro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- Pass --output-name as a single argument so a name with spaces is not split.
- Drop a trailing .json from the name, KICS appends the extension itself.
- Resolve the entrypoint.sh conflict with the path flags now kept in "$@".
- Remove the output_name entry from args, nothing reads positional arguments.
- Document output_name in the README.
- Cover the flag, the report lookup and the cleanup with tests.
@cx-artur-ribeiro

Copy link
Copy Markdown
Contributor

Thanks for this @rasta-rocket!
Since master moved on (path arguments are now passed quoted), so I'll push a merge commit plus one follow-up commit to this branch. It quotes --output-name, drops a trailing .json, documents the input and adds tests. Your commit is untouched, and a git reset --hard e28e162 undoes my additions if you prefer.

@rasta-rocket

Copy link
Copy Markdown
Contributor Author

Thanks for this @rasta-rocket!
Since master moved on (path arguments are now passed quoted), so I'll push a merge commit plus one follow-up commit to this branch. It quotes --output-name, drops a trailing .json, documents the input and adds tests. Your commit is untouched, and a git reset --hard e28e162 undoes my additions if you prefer.

LGTM

You can proceed @cx-artur-ribeiro 👍

@cx-rui-araujo cx-rui-araujo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cx-artur-ribeiro
cx-artur-ribeiro merged commit 4600d2f into Checkmarx:master Oct 16, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants