@@ -57,10 +57,53 @@ inputs:
5757 token :
5858 description : ' Github Token.'
5959 required : true
60+ virustotal_api_key :
61+ description : ' The VirusTotal API key to use for scanning the artifacts.'
62+ required : false
6063
6164runs :
6265 using : " composite"
6366 steps :
67+ - name : VirusTotal
68+ if : inputs.virustotal_api_key != ''
69+ id : vt
70+ uses : cssnr/virustotal-action@v1.3.1
71+ with :
72+ file_globs : ${{ inputs.artifacts }}
73+ summary : true
74+ update_release : false
75+ vt_api_key : ${{ inputs.virustotal_api_key }}
76+
77+ - name : Format VirusTotal Results
78+ if : inputs.virustotal_api_key != ''
79+ id : format-vt
80+ shell : bash
81+ run : |
82+ # Create body file with original content
83+ cat > release_body.md << 'BODY_EOF'
84+ ${{ inputs.body }}
85+ BODY_EOF
86+
87+ # If we have VT results, append them
88+ if [ -n '${{ steps.vt.outputs.json }}' ]; then
89+ # Add separator if body exists and isn't empty
90+ if [ -s release_body.md ] && [ "$(cat release_body.md | tr -d '[:space:]')" != "" ]; then
91+ echo "" >> release_body.md
92+ fi
93+
94+ # Append VirusTotal results
95+ echo "---" >> release_body.md
96+ echo "🛡️ **VirusTotal Results:**" >> release_body.md
97+ printf '%s\n' '${{ steps.vt.outputs.json }}' | jq -r '.[] | "- [\(.name)](\(.link))"' >> release_body.md
98+ fi
99+
100+ # Set output
101+ {
102+ echo "body<<EOF"
103+ cat release_body.md
104+ echo "EOF"
105+ } >> $GITHUB_OUTPUT
106+
64107 - name : Create/Update GitHub Release
65108 if : >-
66109 github.repository == 'LizardByte/actions' ||
70113 allowUpdates : ${{ inputs.allowUpdates }}
71114 artifactErrorsFailBuild : ${{ inputs.artifactErrorsFailBuild }}
72115 artifacts : ${{ inputs.artifacts }}
73- body : ${{ inputs.body }}
116+ body : ${{ steps.format-vt.outputs.body || inputs.body }}
74117 commit : ${{ github.sha }}
75118 generateReleaseNotes : ${{ inputs.generateReleaseNotes }}
76119 name : ${{ inputs.name }}
0 commit comments