Skip to content

Commit e458886

Browse files
authored
chore(ci): add CodeQL (#727)
<!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Bug fixes and new features should include tests. Contributors guide: https://github.com/foundry-rs/foundry/blob/master/CONTRIBUTING.md The contributors guide includes instructions for running rustfmt and building the documentation. --> <!-- ** Please select "Allow edits from maintainers" in the PR Options ** --> ## Motivation <!-- Explain the context and why you're making that change. What is the problem you're trying to solve? In some cases there is not a problem and this can be thought of as being the motivation for your change. --> This PR introduces CodeQL code scanning initially just focused on Github actions as it is fast to run. https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql Results are reported privately in the `security` tab. ## Solution <!-- Summarize the solution and provide any necessary context needed to understand the code change. --> This workflow was derived from the default workflow example Github provides enhanced with concurrency cancel in progress, updated cron to run daily and allow workflow dispatch. Trigger on cron, pull requests and pushes to master.
1 parent bee2974 commit e458886

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
schedule:
9+
- cron: "0 0 * * *"
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
analyze:
18+
name: Analyze (${{ matrix.language }})
19+
runs-on: ubuntu-latest
20+
permissions:
21+
security-events: write
22+
packages: read
23+
actions: read
24+
contents: read
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
include:
30+
- language: actions
31+
build-mode: none
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v5
36+
with:
37+
persist-credentials: false
38+
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@v3
41+
with:
42+
languages: ${{ matrix.language }}
43+
build-mode: ${{ matrix.build-mode }}
44+
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@v3
47+
with:
48+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)