mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-19 02:13:58 +00:00
fix: prevent shell injection in action, suppress stdout in --json mode
- action.yml: pass inputs via env vars, whitelist allowed commands - All --json commands: use no-op spinner to prevent stdout pollution - remove: run AGENTS.md update before JSON output (was skipped) - eval: gate spinner on json format, wrap in try/catch for cleanup - scan: wrap spinner in try/catch for cleanup on failure
This commit is contained in:
@@ -34,11 +34,32 @@ runs:
|
||||
|
||||
- name: Run SkillKit
|
||||
shell: bash
|
||||
env:
|
||||
SK_COMMAND: ${{ inputs.command }}
|
||||
SK_SOURCE: ${{ inputs.source }}
|
||||
SK_AGENT: ${{ inputs.agent }}
|
||||
SK_ARGS: ${{ inputs.args }}
|
||||
run: |
|
||||
if [ "${{ inputs.command }}" = "install" ] && [ -n "${{ inputs.source }}" ]; then
|
||||
skillkit install "${{ inputs.source }}" --agent "${{ inputs.agent }}" --yes --json ${{ inputs.args }}
|
||||
elif [ "${{ inputs.command }}" = "scan" ] && [ -n "${{ inputs.source }}" ]; then
|
||||
skillkit scan "${{ inputs.source }}" --json ${{ inputs.args }}
|
||||
else
|
||||
skillkit ${{ inputs.command }} ${{ inputs.args }}
|
||||
fi
|
||||
case "${SK_COMMAND}" in
|
||||
install)
|
||||
if [ -n "${SK_SOURCE}" ]; then
|
||||
skillkit install "${SK_SOURCE}" --agent "${SK_AGENT}" --yes --json ${SK_ARGS}
|
||||
else
|
||||
echo "Error: source is required for install" >&2; exit 1
|
||||
fi
|
||||
;;
|
||||
scan)
|
||||
if [ -n "${SK_SOURCE}" ]; then
|
||||
skillkit scan "${SK_SOURCE}" --json ${SK_ARGS}
|
||||
else
|
||||
echo "Error: source is required for scan" >&2; exit 1
|
||||
fi
|
||||
;;
|
||||
check|sync|list|update)
|
||||
skillkit "${SK_COMMAND}" ${SK_ARGS}
|
||||
;;
|
||||
*)
|
||||
echo "Error: unsupported command '${SK_COMMAND}'. Use: install, scan, check, sync, list, update" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user