Skip to content

add virustotal scan to CI release workflow #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 24, 2020
Merged
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,34 @@ jobs:
rm -v release/._ArduinoCreateAgent*.dmg
mv -v ArduinoCreateAgent-windows*/* release/

- name: VirusTotal Scan
id: virustotal_step
uses: crazy-max/ghaction-virustotal@v2
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we trust this 3rd party action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing it does is uploading binaries to virustotal. I don't see the problem

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the github token is not required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it used to update the release artifacts?

Copy link
Contributor Author

@umbynos umbynos Dec 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but it's not used because the workflow is not triggered by a release (The trigger is on:push:tags)

update_release_body: false # `true` won't work becasue trigger type is not release
files: |
release/*.exe
arduino-create-agent-windows-2019-386/arduino-create-agent.exe
arduino-create-agent-windows-2019-amd64/arduino-create-agent.exe

- name: Organize release body message #use sed to clean and format the output markdown style
id: release_body
run: |
vt_title="## VirusTotal analysis 🛡: %0A"
vt_links="$(echo ${{ steps.virustotal_step.outputs.analysis}} | sed 's/release\///g' | sed 's/,/\n/g' | sed 's/^/- [/' | sed 's/=/](/' | sed 's/$/)/')"
vt_links="${vt_links//$'\n'/'%0A'}" # replace \n with a special character -> generates a single lines, \n will be reintroduced later
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo "::set-output name=RBODY::$vt_title$vt_links"

- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ""
body: ${{ steps.release_body.outputs.RBODY}}
draft: false
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}

Expand Down