Skip to content

Commit 2a1e91e

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

2 files changed

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

0 commit comments

Comments
 (0)