-
Notifications
You must be signed in to change notification settings - Fork 30
Add static analysis CI (cppcheck, Sparse, Smatch) #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,172 @@ | ||||||
| name: Static Analysis | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| paths: | ||||||
| - 'kernel/realsense/**' | ||||||
| push: | ||||||
| branches: [master, dev] | ||||||
| paths: | ||||||
| - 'kernel/realsense/**' | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
| permissions: read-all | ||||||
|
|
||||||
| jobs: | ||||||
| cppcheck: | ||||||
| name: cppcheck | ||||||
| runs-on: ubuntu-latest | ||||||
| timeout-minutes: 10 | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
||||||
| - uses: actions/checkout@v4 | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actions/upload-artifact action should use a pinned commit hash instead of a version tag for security. The existing workflows in this repository use pinned commit hashes for GitHub Actions to prevent supply chain attacks.
| uses: actions/upload-artifact@v4 | |
| uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actions/checkout action should use a pinned commit hash instead of a version tag for security. The existing workflows in this repository use pinned commit hashes for GitHub Actions to prevent supply chain attacks.
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloning from the smatch repository using only --depth=1 without pinning a specific commit hash creates a security and reproducibility risk. If the repository is compromised or the HEAD commit changes, the workflow could pull in different code. Consider pinning to a specific commit hash or tag.
| git clone --depth=1 https://github.com/error27/smatch.git /tmp/smatch | |
| git clone --depth=1 --branch v1.72 https://github.com/error27/smatch.git /tmp/smatch |
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actions/upload-artifact action should use a pinned commit hash instead of a version tag for security. The existing workflows in this repository use pinned commit hashes for GitHub Actions to prevent supply chain attacks.
| uses: actions/upload-artifact@v4 | |
| uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path filter only triggers on
kernel/realsense/**changes, but the workflow itself (.github/workflows/static-analysis.yml) is not included. If you modify the workflow file, it won't run to validate the changes. Consider adding.github/workflows/static-analysis.ymlto the paths filter so the workflow runs when it's modified, allowing you to test workflow changes in PRs.