1515# limitations under the License.
1616#
1717
18- name : " CodeQL "
18+ name : codeql-analysis
1919
2020on :
2121 push :
22- branches : [ 2.x ]
22+ branches : [ " 2.x", "main" ]
2323 pull_request :
24- # The branches below must be a subset of the branches provided in `on.push.branches`
25- branches : [ 2.x ]
24+ branches : [ "2.x", "main" ]
2625 schedule :
2726 - cron : ' 32 12 * * 5'
2827
@@ -31,51 +30,13 @@ permissions: read-all
3130jobs :
3231
3332 analyze :
34- name : Analyze
35- runs-on : ubuntu-latest
33+ uses : apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@main
34+ with :
35+ java-version : |
36+ 11
37+ 8
38+ # Permissions required to publish Security Alerts
3639 permissions :
3740 actions : read
3841 contents : read
3942 security-events : write
40-
41- strategy :
42- fail-fast : false
43- matrix :
44- language : [ 'java' ]
45- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
46- # Learn more about CodeQL language support at https://git.io/codeql-language-support
47-
48- steps :
49-
50- - name : Checkout repository
51- uses : actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # 4.1.0
52-
53- # Initializes the CodeQL tools for scanning.
54- - name : Initialize CodeQL
55- uses : github/codeql-action/init@2cb752a87e96af96708ab57187ab6372ee1973ab # 2.22.0
56- with :
57- languages : ${{ matrix.language }}
58- # If you wish to specify custom queries, you can do so here or in a config file.
59- # By default, queries listed here will override any specified in a config file.
60- # Prefix the list here with "+" to use these queries and those in the config file.
61- # queries: ./path/to/local/query, your-org/your-repo/queries@main
62-
63- # JDK 11 is used for the build.
64- - name : Setup JDK
65- uses : actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # 3.13.0
66- with :
67- distribution : temurin
68- java-version : 11
69- cache : maven
70-
71- - name : Build with Maven
72- timeout-minutes : 60
73- shell : bash
74- run : |
75- ./mvnw \
76- --show-version --batch-mode --errors --no-transfer-progress \
77- -DskipTests -P!java8-tests \
78- clean verify
79-
80- - name : Perform CodeQL Analysis
81- uses : github/codeql-action/analyze@2cb752a87e96af96708ab57187ab6372ee1973ab # 2.22.0
0 commit comments