Skip to content

Commit

Permalink
Add logging for VT
Browse files Browse the repository at this point in the history
  • Loading branch information
nvdaes committed May 27, 2024
1 parent 37fa316 commit 68a34dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/virusTotalAnalysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ module.exports = ({core}) => {
return;
}
exec(`vt file ${sha256} -k ${process.env.API_KEY} --format json`, (err, stdout, stderr) => {
console.log(stdout);
const vtData = JSON.parse(stdout);
console.log(`err: ${err}`);
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
try {
const vtData = JSON.parse(stdout);
} catch(err) {
console.log(`Error: ${err}`);
}
fs.writeFileSync('vt.json', stdout);
const stats = vtData[0]["last_analysis_stats"];
const malicious = stats.malicious;
Expand Down

0 comments on commit 68a34dc

Please sign in to comment.