Skip to content

Commit

Permalink
refact: CodeQL Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
wallanpsantos committed Nov 8, 2024
1 parent bd6fe99 commit 141cd8a
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions .github/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,61 @@ name: CodeQL Analysis

on:
push:
branches: [ main ]
branches: [ "main" ]
pull_request:
# Branches to consider in pull requests
branches: [ main ]
branches: [ "main" ]
schedule:
- cron: '0 1 * * 3' # Executa toda quarta-feira à 01:00 UTC
- cron: '36 0 * * 3' # todas as quartas-feiras às 00:36 (meia-noite e 36 minutos) no fuso horário UTC.

jobs:
analyze:
name: CodeQL Analyze
runs-on: ubuntu-latest
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}

permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
language: [ 'java-kotlin' ]
# Adicione outras linguagens se houver, como 'javascript', 'python', etc.
build-mode: [ none ]
# Adicione none ou manual dentro do array para cair em alguma execução abaixo.

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# Descomentar o a linha abaixo para ativa suporte para repositórios privados.
# database-upgrades: false
build-mode: ${{ matrix.build-mode }}

- name: Build the code
if: matrix.build-mode == 'none'
run: |
# Comando para rodar o build da aplicação:
mvn clean install -DskipTests
mvn clean install -DskipTests -U
- name: Manual Build Commands
if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'Executando o build manual para análise do CodeQL'
# Comandos específicos para build manual:
mvn clean install -DskipTests -U
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

0 comments on commit 141cd8a

Please sign in to comment.