Skip to content

Commit

Permalink
Update PR with VirusTotal report
Browse files Browse the repository at this point in the history
  • Loading branch information
kmturley committed Sep 19, 2024
1 parent c8e7c51 commit b1ff71e
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,33 @@ jobs:

- name: VirusTotal Report
uses: actions/github-script@v7
env:
ANALYSIS: ${{steps.virustotal.outputs.analysis}}
with:
script: |
const { ANALYSIS } = process.env;
console.log(ANALYSIS);
const analysis = '${{steps.virustotal.outputs.analysis}}';
if (!analysis) return;
let output = 'VirusTotal Report';
let lines = analysis.split(',');
for (let line of lines) {
output += '- ' + file.replace('=https', ': https') + '\n';
}
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
});
const existingComment = comments.find(comment => comment.user.id === 41898282);
if (existingComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: commentBody
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
body: commentBody
});
}

0 comments on commit b1ff71e

Please sign in to comment.