Skip to content

Commit 854eae9

Browse files
author
Joonas Hiltunen
committed
Add CodeQL
1 parent 6e17846 commit 854eae9

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CodeQL analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "0 8 * * *" # every day at 8 AM UTC
12+
13+
permissions:
14+
security-events: write
15+
packages: read
16+
contents: read
17+
actions: read
18+
19+
jobs:
20+
analyze:
21+
uses: HSLdevcom/jore4-tools/.github/workflows/shared-codeql.yml@shared-ghas-workflows-v1
22+
with:
23+
languages: '["actions", "python"]'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Shared CodeQL analysis
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
languages:
7+
description: 'Languages to analyze (JSON array, e.g., ["actions", "javascript-typescript", "java-kotlin"])'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
analyze:
13+
name: Analyze code
14+
runs-on: ubuntu-24.04
15+
permissions:
16+
# required for all workflows
17+
security-events: write
18+
# required to fetch internal or private CodeQL packs
19+
packages: read
20+
# only required for workflows in private repositories
21+
actions: read
22+
# repository contents
23+
contents: read
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language: ${{ fromJSON(inputs.languages) }}
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v5
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@v4
34+
with:
35+
languages: ${{ matrix.language }}
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v4
39+
with:
40+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)