Scan a batch of submitted add-ons with Virus Total #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scan all submitted add-ons with Virus Total | |
on: | |
workflow_dispatch: | |
jobs: | |
virusTotal-analysis: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
python-version: [ 3.11 ] | |
permissions: | |
contents: write | |
env: | |
VT_API_KEY: ${{ secrets.VT_API_KEY }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.headRef }} | |
- name: Install virusTotal | |
run: choco install vt-cli | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
- name: Install glob | |
run: npm install glob | |
- name: Submit add-ons with VirusTotal | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const virusTotalSubmit = require('./.github/workflows/virusTotalSubmit.js') | |
virusTotalSubmit({core}, "./addons/*/*.json") | |
- name: Set Virus Total analysis status | |
if: always() | |
id: setVirusTotalAnalysisStatus | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const setVirusTotalAnalysisStatus = require('./.github/workflows/virusTotalAnalysis.js') | |
setVirusTotalAnalysisStatus({core}, "./addons/*/*.json") | |
- name: Commit and push updated VT urls | |
if: always() | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add ./addons/*/*.json | |
git commit -m "update VT review URLs" | |
git branch -u origin/master | |
git pull | |
git push | |
- name: Upload results | |
id: uploadResults | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: VirusTotal | |
path: vt.json | |
overwrite: true | |
- name: Upload manual approval | |
id: uploadManualApproval | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: manualApproval | |
path: reviewedAddons.json | |
overwrite: true |