Skip to content

Commit 6b506fc

Browse files
chore: deploy standalone CodeQL workflow (#106)
Co-authored-by: mx51-security-automator[bot] <270226954+mx51-security-automator[bot]@users.noreply.github.com>
1 parent 2978b6b commit 6b506fc

1 file changed

Lines changed: 46 additions & 10 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,52 @@
1+
# MX51 PUBLIC CodeQL SCAN
2+
# Self-contained scan for public repos (cannot use the private central template).
3+
# Edit here in github-security-automation and re-run the push action to update all public repos.
14
name: "CodeQL"
2-
35
on:
46
schedule:
5-
- cron: '30 22 * * 4'
7+
- cron: '30 22 * * 5' # weekly, UTC
68
workflow_dispatch:
79

810
jobs:
9-
run-security-scan:
10-
uses: mx51/github-security-automation/.github/workflows/codeql.yml@main
11-
# Uncomment and modify the lines below ONLY if the repo requires manual compilation
12-
# with:
13-
# runner_size: "ubuntu-latest-4core"
14-
# build_command: "./gradlew clean build"
15-
secrets: inherit
16-
11+
create-matrix:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
matrix: ${{ steps.set-matrix.outputs.languages }}
15+
steps:
16+
- name: Get languages from repo
17+
id: set-matrix
18+
uses: advanced-security/set-codeql-language-matrix@v1
19+
with:
20+
access-token: ${{ secrets.GITHUB_TOKEN }}
21+
endpoint: ${{ github.event.repository.languages_url }}
22+
23+
analyze:
24+
needs: create-matrix
25+
if: ${{ needs.create-matrix.outputs.matrix != '[]' }}
26+
name: Analyze
27+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
28+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
29+
permissions:
30+
actions: read
31+
contents: read
32+
security-events: write
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
language: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v6
40+
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v4
43+
with:
44+
languages: ${{ matrix.language }}
45+
46+
- name: Autobuild
47+
uses: github/codeql-action/autobuild@v4
48+
49+
- name: Perform CodeQL Analysis
50+
uses: github/codeql-action/analyze@v4
51+
with:
52+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)