Skip to content

Commit

Permalink
refact: CodeQL Analysis (#7)
Browse files Browse the repository at this point in the history
* refact: CodeQL Analysis

* refact: CodeQL Analysis

* refact: CodeQL Analysis
  • Loading branch information
wallanpsantos authored Nov 8, 2024
1 parent 4e1a6f6 commit 4939f6e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 45 deletions.
45 changes: 0 additions & 45 deletions .github/codeql-analysis.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CodeQL Analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- 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

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

strategy:
fail-fast: false
matrix:
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: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
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 -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 4939f6e

Please sign in to comment.