diff --git a/.github/workflows/codeql-daily.yml b/.github/workflows/codeql-daily.yml deleted file mode 100644 index 3331db67be3..00000000000 --- a/.github/workflows/codeql-daily.yml +++ /dev/null @@ -1,44 +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: 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 - - open-issue-on-failure: - # open an issue on failure because it can be easy to miss CI failure notifications - needs: - - analyze - if: failure() && github.run_attempt == 1 - uses: ./.github/workflows/reusable-open-issue-on-failure.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000000..677f40b48ae --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,54 @@ +name: CodeQL + +on: + pull_request: + branches: + - main + - release/* + - benchmarks + push: + branches: + - main + - release/* + - benchmarks + 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Java 17 + uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 + with: + distribution: temurin + java-version: 17 + + - name: Set up gradle + uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 + + - name: Initialize CodeQL + uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 + 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@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8