Skip to content

Commit

Permalink
Run VT action on pull request close
Browse files Browse the repository at this point in the history
Run VT action on pull request close
  • Loading branch information
HotCakeX committed Oct 26, 2024
1 parent 87f4c06 commit dacf8b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/Workflowstuff/VirusTotal.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ErrorActionPreference = 'Stop'

# Function to upload file to VirusTotal
function Upload-FileToVirusTotal {
function Invoke-VTFileUpload {
param (
[System.String]$FilePath,
[System.String]$ApiKey
Expand Down Expand Up @@ -70,7 +70,7 @@ function Get-VirusTotalReport {
$Headers.Add('x-apikey', $ApiKey)

# Upload the file to virus total
$AnalysisData = Upload-FileToVirusTotal -filePath $FilePath -apiKey $ApiKey
$AnalysisData = Invoke-VTFileUpload -filePath $FilePath -apiKey $ApiKey

# Fetch the report from VirusTotal
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
# Write the MSIXPath to GITHUB_ENV to set it as an environment variable for the entire workflow
Add-Content -Path $env:GITHUB_ENV -Value "MSIX_PATH=$MSIXPath"
- name: Generate Artifact Attestation
- name: Generating Artifact Attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: ${{ env.MSIX_PATH }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/VirusTotal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Repository And Package Scan on Virus Total
on:
workflow_dispatch:
release: # to trigger on releases
pull_request:
types:
- closed # When a pull request is closed. Merging also results in closing the pull request.

jobs:
run-script:
Expand Down

0 comments on commit dacf8b0

Please sign in to comment.