Skip to content

Commit e443488

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

2 files changed

Lines changed: 66 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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Shared CodeQL analysis
2+
# CodeQL documentation https://github.com/github/codeql-action
3+
# CodeQL supported languages https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks
4+
# Also see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#changing-the-languages-that-are-analyzed
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
languages:
10+
description: 'Languages to analyze (JSON array, e.g., ["actions"]). See supported languages at https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
analyze:
16+
name: Analyze code
17+
runs-on: ubuntu-24.04
18+
permissions:
19+
# required for all workflows
20+
security-events: write
21+
# required to fetch internal or private CodeQL packs
22+
packages: read
23+
# only required for workflows in private repositories
24+
actions: read
25+
# repository contents
26+
contents: read
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
language: ${{ fromJSON(inputs.languages) }}
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v5
34+
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v4
37+
with:
38+
languages: ${{ matrix.language }}
39+
40+
- name: Perform CodeQL Analysis
41+
uses: github/codeql-action/analyze@v4
42+
with:
43+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)