-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (42 loc) · 1.32 KB
/
CodeQL_Example02_Java.yml
File metadata and controls
57 lines (42 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: CodeQL Example02 Java
on:
# push:
# branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Container_Example02_Java:
runs-on: 'Ubuntu-latest'
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [Java]
container:
image: openjdk:8
options: --user root
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set safe directory
run: |
git config --global --add safe.directory /__w/CodeQL_containerizedApp/CodeQL_containerizedApp/
- name: Install dependencies
working-directory: /__w/CodeQL_containerizedApp/CodeQL_containerizedApp/Example02_Java/
run: |
apt-get update && \
apt-get install build-essential maven default-jdk cowsay netcat -y && \
update-alternatives --config javac
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Build with Maven
working-directory: /__w/CodeQL_containerizedApp/CodeQL_containerizedApp/Example02_Java/
run: |
mvn -B package --file pom.xml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2