From fb2a560d59d08abab401a6b745eeb4170883f7cd Mon Sep 17 00:00:00 2001 From: "cko-developer-portal[bot]" <89167155+cko-developer-portal[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:36:31 +0100 Subject: [PATCH] CodeQL workflow for Java (#214) --- .github/workflows/codeql-analysis.yml | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..d9de70614 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,57 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + types: [ opened, synchronize, reopened ] + branches: [ master, "bugfix/*", "feature/*", "release/*" ] + schedule: + - cron: '34 2 * * 0' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + analyze: + name: Code Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: corretto + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: security-and-quality + + - name: Build with Gradle + run: ./gradlew :app:build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2