-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add qodana analyzer #1
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,29 @@ | ||
| name: Qodana | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| push: | ||
| branches: # Specify your branches here | ||
| - main # The 'main' branch | ||
| - 'releases/*' # The release branches | ||
| - develop | ||
|
|
||
| jobs: | ||
| qodana: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| checks: write | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 suggestion (security): Consider pinning GitHub Actions to a specific commit for better supply-chain security. Tag references like Suggested implementation: To fully implement the supply-chain hardening:
|
||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Using This field only exists on |
||
| fetch-depth: 0 # a full history is required for pull request analysis | ||
| - name: 'Qodana Scan' | ||
| uses: JetBrains/qodana-action@v2026.1 | ||
| with: | ||
| pr-mode: true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Because this workflow also runs on |
||
| env: | ||
| QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} | ||
| QODANA_ENDPOINT: 'https://qodana.cloud' | ||
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.
🚨 suggestion (security): Permissions look broader than needed and could be tightened.
For a static analysis workflow,
contents: write,pull-requests: write, andchecks: writeare quite elevated. If Qodana only needs to create/update checks and comment on PRs, consider droppingcontents: writeand reducing other scopes toreadwhere possible. Minimizing permissions reduces impact if the workflow token is ever misused or compromised.