/
Using Node.js Agents - Uploading git commit logs

Using Node.js Agents - Uploading git commit logs

If you do not work with GitHub or cannot provide access to the source folder where the Git logs are located, you can generate them on your own and upload them separately to the SeaLights servers.

See 'Generating an Agent token' for instructions on how to generate a token

Generating the commit reports

The file must be a JSON file with an array of commits named "commitLog"

Sample command on Linux
echo "{ \"commitLog\": " > commitLog.json git log --pretty=format:'{"commit": "%H","authorName": "%an","authorEmail": "%ae","commiterName": "%cn","commiterEmail": "%ce","authorDate": "%at000","commiterDate": "%ct000","title": "%f"},' --since="2 days ago" | sed "$ s/,$//" | sed ':a;N;$!ba;s/\r\n\([^{]\)/\\n\1/g'| awk 'BEGIN { print("[") } { print($0) } END { print("]") }' >> commitLog.json echo "}" >> commitLog.json

Upload git-generated commit log reports

Sample command for a single file
Unix: npx slnodejs uploadReports --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --reportFile commitLog.json --type "commitLog" --source "script" Windows: call npx slnodejs uploadReports --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --reportFile commitLog.json --type "commitLog" --source "script"

 

Related content

Using Java Agents - Uploading git commit logs
Using Java Agents - Uploading git commit logs
More like this
Analyzing a GitHub Enterprise Pull Request
Analyzing a GitHub Enterprise Pull Request
More like this
SeaLights Node.js agent - Command Reference
SeaLights Node.js agent - Command Reference
More like this
Analyzing a GitHub.com Pull Request
Analyzing a GitHub.com Pull Request
More like this
Configuring your Pull Request flow to report to SeaLights
Configuring your Pull Request flow to report to SeaLights
More like this
SeaLights Node.js agent - Scanning and Instrumentation of a Front-End app
SeaLights Node.js agent - Scanning and Instrumentation of a Front-End app
More like this