Skip to content

Commit 2537df7

Browse files
Merge pull request #20 from shwetaverma14/fix-codeql-auth
fix: CodeQL authentication and test compilation
2 parents 3cf30e6 + 4caa23f commit 2537df7

File tree

1 file changed

+42
-27
lines changed

1 file changed

+42
-27
lines changed
Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,64 @@
11
name: "CodeQL"
22

3-
permissions:
4-
contents: read
5-
actions: read
6-
security-events: write
7-
83
on:
94
push:
10-
branches: ["main"]
5+
branches: [ "main" ]
116
pull_request:
12-
branches: ["main"]
7+
branches: [ "main" ]
138
schedule:
14-
- cron: "0 3 * * 1"
9+
- cron: '0 3 * * 1'
1510

1611
jobs:
1712
analyze:
1813
name: Analyze
1914
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
2019

2120
strategy:
2221
fail-fast: false
2322
matrix:
24-
language: ["java"]
23+
language: [ 'java' ]
2524

2625
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v3
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Set up JDK 17
32+
uses: actions/setup-java@v4
33+
with:
34+
java-version: '17'
35+
distribution: 'temurin'
36+
37+
- name: Install Groovy
38+
run: sudo apt-get update && sudo apt-get install -y groovy
2939

30-
- name: Set up JDK 17
31-
uses: actions/setup-java@v3
32-
with:
33-
java-version: "17"
34-
distribution: "temurin"
35-
cache: "maven"
40+
- name: Clone and build apis-bom
41+
run: |
42+
git clone https://github.com/hyphae/apis-bom.git ../apis-bom
43+
cd ../apis-bom
44+
mvn -B clean install
3645
37-
- name: Install Groovy
38-
run: sudo apt-get update && sudo apt-get install -y groovy
46+
- name: Clone and build apis-common
47+
run: |
48+
git clone https://github.com/hyphae/apis-common.git ../apis-common
49+
cd ../apis-common
50+
BOM_VERSION=$(grep -oP '<version>\K[^<]+' ../apis-bom/pom.xml | head -1)
51+
sed -i "s/<version>3.0.0<\\/version>/<version>$BOM_VERSION<\\/version>/" pom.xml
52+
mvn -B clean install
3953
40-
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@v2
42-
with:
43-
languages: ${{ matrix.language }}
54+
- name: Initialize CodeQL
55+
uses: github/codeql-action/init@v3
56+
with:
57+
languages: ${{ matrix.language }}
4458

45-
- name: Autobuild
46-
uses: github/codeql-action/autobuild@v2
59+
- name: Build for CodeQL Analysis
60+
run: |
61+
mvn -B clean compile test-compile
4762
48-
- name: Perform CodeQL Analysis
49-
uses: github/codeql-action/analyze@v2
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)