diff --git a/.github/workflows/codeql-daily.yml b/.github/workflows/codeql-daily.yml deleted file mode 100644 index 6db20f874..000000000 --- a/.github/workflows/codeql-daily.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: CodeQL (daily) - -on: - schedule: - # Daily at 01:30 (UTC) - - cron: '30 1 * * *' - workflow_dispatch: - -jobs: - analyze: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Java 17 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 17 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: java - # using "latest" helps to keep up with the latest Kotlin support - # see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433 - tools: latest - - - name: Set up gradle - uses: gradle/actions/setup-gradle@v4 - - name: Gradle assemble - # skipping build cache is needed so that all modules will be analyzed - run: ./gradlew assemble --no-build-cache - - - name: Perform CodeQL analysis - uses: github/codeql-action/analyze@v3 - - workflow-notification: - needs: - - analyze - if: always() - uses: ./.github/workflows/reusable-workflow-notification.yml - with: - success: ${{ needs.analyze.result == 'success' }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..6751f922a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,64 @@ +name: CodeQL + +on: + pull_request: + branches: + - main + - release/* + - v0.* + - v1.* + push: + branches: + - main + - release/* + - v0.* + - v1.* + schedule: + - cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday + +permissions: + contents: read + +jobs: + analyze: + permissions: + contents: read + actions: read # for github/codeql-action/init to get workflow details + security-events: write # for github/codeql-action/analyze to upload SARIF results + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Java 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + + - name: Set up gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: java, actions + # using "latest" helps to keep up with the latest Kotlin support + # see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433 + tools: latest + + - name: Assemble + # --no-build-cache is required for codeql to analyze all modules + # --no-daemon is required for codeql to observe the compilation + # (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands) + run: ./gradlew assemble --no-build-cache --no-daemon + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + + workflow-notification: + needs: + - analyze + if: always() + uses: ./.github/workflows/reusable-workflow-notification.yml + with: + success: ${{ needs.analyze.result == 'success' }}