Skip to main content
Panther Knowledge Base

Running tests and uploading only the modified files from the previous commit when working with the Panther Analysis Tool

QUESTION

I'm working on the Developer Workflows using the Panther Analysis ToolI would like to only run the tests and upload the modified files from the previous commit, essentially being able to provide multiple paths. Is it possible to do this?

ANSWER

While the Panther Analysis Tool doesn't currently support multi-path, there is a workaround that can help.

Since the operation is test and upload, in your CI pipeline you may be able to take the matrix of files with changes, copy them to a temporary folder in CI (say an /upload folder), and run the PAT command on that directory. In other words, the process is about feeding a list of changed files to a bash script, something like the below:

while IFS= read -r line; do [ -f "$line" ] && \
cp "$line" ./upload || echo "Skipping directory: $line"; done \
< "$PATHS"

and giving PAT the ./upload path.

Since these changes are ephemeral in a CI pipeline, copying the files has no impact on the repository.