Skip to content

Commit 1f26353

Browse files
authored
chore(ci): add CodeQL workflow configuration (#66)
1 parent 6273e5e commit 1f26353

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '30 09 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
# Runner size impacts CodeQL analysis time. To learn more, please see:
15+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
16+
# - https://gh.io/supported-runners-and-hardware-resources
17+
# - https://gh.io/using-larger-runners (GitHub.com only)
18+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
19+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
20+
permissions:
21+
# required for all workflows
22+
security-events: write
23+
24+
# required to fetch internal or private CodeQL packs
25+
packages: read
26+
27+
# only required for workflows in private repositories
28+
actions: read
29+
contents: read
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
- language: actions
36+
build-mode: none
37+
- language: ruby
38+
build-mode: none
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
# Add any setup steps before running the `github/codeql-action/init` action.
44+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
45+
# or others). This is typically only required for manual builds.
46+
# - name: Setup runtime (example)
47+
# uses: actions/setup-example@v1
48+
49+
# Initializes the CodeQL tools for scanning.
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@v4
52+
with:
53+
languages: ${{ matrix.language }}
54+
build-mode: ${{ matrix.build-mode }}
55+
56+
# If the analyze step fails for one of the languages you are analyzing with
57+
# "We were unable to automatically build your code", modify the matrix above
58+
# to set the build mode to "manual" for that language. Then modify this step
59+
# to build your code.
60+
# ℹ️ Command-line programs to run using the OS shell.
61+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
62+
- name: Run manual build steps
63+
if: matrix.build-mode == 'manual'
64+
shell: bash
65+
run: |
66+
echo 'If you are using a "manual" build mode for one or more of the' \
67+
'languages you are analyzing, replace this with the commands to build' \
68+
'your code, for example:'
69+
echo ' make bootstrap'
70+
echo ' make release'
71+
exit 1
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v4
75+
with:
76+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)