Skip to content

Commit

Permalink
update-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
azurejoga committed Dec 27, 2023
1 parent af005a3 commit c0578d5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
name: Fortify AST Scan
name: Verificar Vírus

on:
push:
branches:
- aurora # ou a branch principal do seu repositório
workflow_dispatch:

jobs:
fortify_ast_scan:
verificar_virus:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Get Latest Release
id: get_release
- name: Executar Script de Verificação de Vírus
run: |
RELEASE=$(curl -s https://api.github.com/repos/azurejoga/Aurora-Windows-Optimizer/releases/latest | jq -r '.tag_name')
echo "Latest Release: $RELEASE"
echo "::set-output name=release::$RELEASE"
- name: Download Files
run: |
RELEASE_TAG=$(echo ${{ steps.get_release.outputs.release }} | sed 's/v//')
DOWNLOAD_URL="https://github.com/azurejoga/Aurora-Windows-Optimizer/releases/download/$RELEASE_TAG/"
curl -LJO $DOWNLOAD_URL/aurora-install.exe
curl -LJO $DOWNLOAD_URL/aurora-windows-optimizer.zip
- name: Fortify AST Scan
uses: fortify/github-action@v1.1.0
chmod +x verificar_virus.sh
./verificar_virus.sh
env:
VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }}
53 changes: 53 additions & 0 deletions .github/workflows/verificar_virus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Obter a versão mais recente do release
RELEASE=$(curl -s https://api.github.com/repos/azurejoga/Aurora-Windows-Optimizer/releases/latest | jq -r '.tag_name')

# Obter a última versão da tag sem o prefixo 'v'
RELEASE_TAG=$(echo $RELEASE | sed 's/v//')

# Construir URLs para os arquivos .zip e .exe
DOWNLOAD_URL="https://github.com/azurejoga/Aurora-Windows-Optimizer/releases/download/$RELEASE_TAG/"
ZIP_FILE="aurora-windows-optimizer.zip"
EXE_FILE="aurora-install.exe"

ZIP_URL="$DOWNLOAD_URL$ZIP_FILE"
EXE_URL="$DOWNLOAD_URL$EXE_FILE"

# Verificar o arquivo .zip com a API do VirusTotal
echo "Verificando $ZIP_FILE com VirusTotal..."
ZIP_RESULT=$(curl -s -X POST "https://www.virustotal.com/api/v3/files" \
-H "x-apikey: $VIRUSTOTAL_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @<(curl -s $ZIP_URL | base64 -w 0) \
| jq -r '.data.id')

# Aguardar a análise no VirusTotal
sleep 30 # Aguarde um tempo para permitir que o VirusTotal processe a verificação

# Obter o status da verificação
ZIP_STATUS=$(curl -s "https://www.virustotal.com/api/v3/analyses/$ZIP_RESULT" \
-H "x-apikey: $VIRUSTOTAL_API_KEY" \
| jq -r '.data.attributes.last_analysis_stats.overall')

# Verificar o arquivo .exe com a API do VirusTotal
echo "Verificando $EXE_FILE com VirusTotal..."
EXE_RESULT=$(curl -s -X POST "https://www.virustotal.com/api/v3/files" \
-H "x-apikey: $VIRUSTOTAL_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @<(curl -s $EXE_URL | base64 -w 0) \
| jq -r '.data.id')

# Aguardar a análise no VirusTotal
sleep 30 # Aguarde um tempo para permitir que o VirusTotal processe a verificação

# Obter o status da verificação
EXE_STATUS=$(curl -s "https://www.virustotal.com/api/v3/analyses/$EXE_RESULT" \
-H "x-apikey: $VIRUSTOTAL_API_KEY" \
| jq -r '.data.attributes.last_analysis_stats.overall')

# Exibir resultados no README.md
echo "# O app foi verificado e não há vírus em .zip ou .exe da versão mais recente"
echo "Versão mais recente: $RELEASE"
echo "Verificação .zip: $ZIP_STATUS"
echo "Verificação .exe: $EXE_STATUS"

0 comments on commit c0578d5

Please sign in to comment.