Merge pull request #12 from sip49/pixeebot/drip-2024-01-19-pixee-java… #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run CodeQL | |
name: "CodeQL" | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
analyse: | |
name: Analyse | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- run: git checkout HEAD^2 | |
if: ${{ github.event_name == 'pull_request' }} | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: java | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v2 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
with: | |
category: "/language:java" | |
- uses: pmd/pmd-github-action@v1 | |
id: pmd | |
with: | |
version: '6.40.0' | |
sourcePath: 'src/main/java' | |
rulesets: 'rulesets/java/quickstart.xml' | |
analyzeModifiedFilesOnly: false | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@v1 | |
with: | |
category: pmd-provided | |
sarif_file: pmd-report.sarif |