diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..8a10fb8 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,50 @@ +on: + workflow_call: + inputs: + languages: + description: 'The programming languages the project is written in.' + required: true + type: string + java-version: + description: 'The version of Java to use.' + required: false + type: string + default: '17' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ${{ fromJson(inputs.languages) }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK ${{ inputs.java-version }} + uses: actions/setup-java@v3 + with: + java-version: ${{ inputs.java-version }} + distribution: 'temurin' + cache: maven + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}"