Skip to content

Commit 0bb081b

Browse files
authored
Create codeql-no-diff.yml
Deleted: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 (.java - .xml - .properties) if: steps.changed-files.outputs.any_changed == 'true') - name: No Changes Summary if: steps.changed-files.outputs.any_changed == 'false' run: | echo "No Java/XML/Properties files changed" echo "⏭CodeQL analysis skipped for performance"
1 parent 942a1a5 commit 0bb081b

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#1) HEADER & TRIGGER
2+
name: "Codeql on PR / Total Scan"
3+
4+
on:
5+
pull_request:
6+
branches: [ "main" ] #Se voglio triggerare su tutti i rami = branches: [ "*" ]
7+
8+
#2) CONFIGURAZIONE JOBS
9+
jobs:
10+
analyze:
11+
name: Analyze Java - Total no Diff
12+
runs-on: ubuntu-latest
13+
14+
#3) PERMESSI - DEFINISCE COSA PUO' FARE IL WORKFLOW NEL REPOSITORY
15+
permissions:
16+
security-events: write # Per scrivere risultati di sicurezza
17+
packages: read # Per scaricare query pack CodeQL
18+
actions: read # Per leggere altri workflow
19+
contents: read # Per leggere il codice del repo
20+
21+
#4) CHECKOUT
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
#5) SETUP JAVA
27+
- name: Setup Java
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: 'temurin'
31+
java-version: '21'
32+
33+
#6) INITIALIZE CODEQL
34+
- name: Initialize CodeQL
35+
uses: github/codeql-action/init@v3
36+
with:
37+
languages: java-kotlin
38+
build-mode: none
39+
config-file: ./.github/codeql/codeql-config.yml
40+
41+
#7) ANALISI CODEQL
42+
- name: Perform CodeQL Analysis
43+
uses: github/codeql-action/analyze@v3
44+
45+
#8) DEBUG
46+
- name: Debug SARIF Path
47+
run: find /home/runner/work/WebGoat/ -name "*.sarif"
48+
49+
#9) UPLOAD SARIF E CREAZIONE ARTIFACT
50+
- name: Upload SARIF
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: sarif-report
54+
path: /home/runner/work/WebGoat/results/java.sarif
55+
56+
#10) SUMMARY
57+
- name: Analysis Summary
58+
run: |
59+
echo "WebGoat CodeQL analysis completed"
60+
echo "Files analyzed: ${{ steps.changed-files.outputs.all_changed_files }}"
61+
echo "Language: java-kotlin"
62+
63+

0 commit comments

Comments
 (0)