From 0335ea9f1e1f105bb5aec0f02b22da4a61afd8fb Mon Sep 17 00:00:00 2001 From: Justin Chu Date: Wed, 20 Mar 2024 17:53:48 -0700 Subject: [PATCH] Use Java 11 to build project in the codeql pipeline (#19999) Codeql uses Java 8 by default, which is too old for the project. Related: https://learn.microsoft.com/en-us/java/openjdk/reasons-to-move-to-java-11 https://github.com/actions/setup-java --- .github/workflows/codeql.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4a5b87b3e69ed..e4d1b91bab736 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -47,6 +47,14 @@ jobs: # Details on CodeQL's query packs refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs queries: security-extended,security-and-quality + # Setup Java to use a version that is not too old for the project + - if: ${{ matrix.language == 'java' }} + name: Setup Java 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'microsoft' + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - if: ${{ matrix.language != 'cpp' }}