-
Notifications
You must be signed in to change notification settings - Fork 0
Add React Doctor to GitHub Actions #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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # React Doctor — finds security, performance, correctness, accessibility, | ||
| # bundle-size, and architecture issues in React codebases. | ||
| # | ||
| # Docs: https://www.react.doctor/ci | ||
| # Source: https://github.com/millionco/react-doctor | ||
|
|
||
| name: React Doctor | ||
|
|
||
| on: | ||
| # Scans the PR's changed files and posts a sticky summary comment listing only the new issues introduced relative to the merge base of the target branch. | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| # Scans `main` on every push to track the health-score trend and catch regressions that slipped past PR review. | ||
| push: | ||
| branches: ["main"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
| statuses: write | ||
|
|
||
| # Cancels any in-flight scan for the same PR (or branch, on push) the moment a new commit arrives, so reviewers only ever see the latest run. | ||
| concurrency: | ||
| group: react-doctor-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| react-doctor: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: millionco/react-doctor@v2 | ||
| # Advisory by default: React Doctor reports findings on every PR — a | ||
| # sticky summary comment, inline review comments, and a commit status | ||
| # with the health score — but never fails the check, so it won't red-X | ||
| # a teammate's PR on day one. When your team trusts the signal, graduate | ||
| # the gate: uncomment the block below and set blocking to "error" (fail | ||
| # on new error-severity findings) or "warning" (fail on any finding). | ||
| # Full reference: https://www.react.doctor/ci | ||
| # with: | ||
| # blocking: error # Gate level: "none" (advisory, the default) | "warning" | "error" | ||
| # scope: full # On PRs, scan the whole project instead of just changed files | ||
| # comment: false # Disable the sticky PR summary comment | ||
| # review-comments: false # Disable inline review comments on changed lines | ||
| # commit-status: false # Disable the commit status (score + counts, links to the run) | ||
| # version: "0.4.0" # Pin to a specific react-doctor version instead of "latest" | ||
| # directory: apps/web # Scan a sub-directory (default: ".") | ||
| # project: "web,admin" # In a monorepo, scan specific workspace project(s) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: ametel01/okf-dashboard
Length of output: 584
Pin third-party actions by commit SHA and disable credential persistence in checkout.
Lines 32–34 use mutable action tags (
@v5,@v2), which creates supply-chain risk. Additionally,actions/checkout@v5leaves credentials persisted by default, unnecessarily exposing the workflow token to later steps.Suggested hardening patch
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 32-32: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 32-32: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 34-34: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools