Skip to content

Add React Doctor to GitHub Actions - #1

Closed
ametel01 wants to merge 1 commit into
mainfrom
react-doctor/add-github-actions
Closed

Add React Doctor to GitHub Actions#1
ametel01 wants to merge 1 commit into
mainfrom
react-doctor/add-github-actions

Conversation

@ametel01

@ametel01 ametel01 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Adds a React Doctor scan to every pull request and every push to the default branch. The workflow file is documented inline.

Docs: https://www.react.doctor/ci

Summary by CodeRabbit

  • Chores
    • Added automated code scanning workflow for pull requests and main branch updates.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow file .github/workflows/react-doctor.yml is added. It runs millionco/react-doctor@v2 on pull request events (opened, synchronize, reopened, ready_for_review) and pushes to main, with least-privilege permissions and concurrency cancellation per PR/branch.

Changes

React Doctor CI Workflow

Layer / File(s) Summary
React Doctor workflow triggers, permissions, and job
.github/workflows/react-doctor.yml
Adds the complete workflow with PR and main-push triggers, scoped contents: read / PR-write permissions, in-flight run cancellation via concurrency, a checkout step, and the millionco/react-doctor@v2 action invocation. Commented blocks document optional configuration for gating, scope, sticky comments, review comments, commit status, version pinning, and directory scanning.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A workflow hops into the .github den,
Scanning React code again and again.
On every pull request it wakes with a cheer,
Doctor React-o will make issues clear!
Least privilege granted, concurrency tamed —
The bunny approves, and the CI is named. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add React Doctor to GitHub Actions' directly and clearly summarizes the main change: adding a React Doctor integration to the GitHub Actions workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch react-doctor/add-github-actions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

No React Doctor issues found. 🎉

Reviewed by React Doctor for commit 7c4b634.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/react-doctor.yml:
- Around line 32-34: The GitHub Actions workflow uses mutable action tags which
creates supply-chain risk and leaves credentials persisted in the checkout step.
Replace the mutable tags `@v5` for actions/checkout and `@v2` for
millionco/react-doctor with pinned commit SHAs to lock these dependencies to
specific versions. Additionally, add `persist-credentials: false` as a
configuration option to the actions/checkout action to disable credential
persistence and prevent unnecessary exposure of the workflow token to subsequent
steps.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 919479b8-0049-433b-922f-e82fefb9b439

📥 Commits

Reviewing files that changed from the base of the PR and between 0a48d07 and 7c4b634.

📒 Files selected for processing (1)
  • .github/workflows/react-doctor.yml

Comment on lines +32 to +34
- uses: actions/checkout@v5

- uses: millionco/react-doctor@v2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all workflow actions are SHA-pinned and checkout disables persisted credentials.

set -euo pipefail

echo "== Action references in workflows =="
rg -n '^\s*-\s*uses:\s*' .github/workflows || true

echo
echo "== Non-SHA-pinned actions (should be empty after fix) =="
rg -nP '^\s*-\s*uses:\s*[^@\s]+@(?![0-9a-fA-F]{40}\b)' .github/workflows || true

echo
echo "== checkout steps missing persist-credentials: false (should be empty after fix) =="
python - <<'PY'
from pathlib import Path
import re

for path in Path(".github/workflows").glob("*.y*ml"):
    text = path.read_text(encoding="utf-8")
    for m in re.finditer(r'(^\s*-\s*uses:\s*actions/checkout@[^\n]+\n(?:^\s+.*\n)*)', text, re.M):
        block = m.group(1)
        if "persist-credentials: false" not in block:
            line = text[:m.start()].count("\n") + 1
            print(f"{path}:{line}")
PY

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@v5 leaves credentials persisted by default, unnecessarily exposing the workflow token to later steps.

Suggested hardening patch
-      - uses: actions/checkout@v5
+      - uses: actions/checkout@<PINNED_SHA_FOR_V5>
+        with:
+          persist-credentials: false

-      - uses: millionco/react-doctor@v2
+      - uses: millionco/react-doctor@<PINNED_SHA_FOR_V2>
🧰 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
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/react-doctor.yml around lines 32 - 34, The GitHub Actions
workflow uses mutable action tags which creates supply-chain risk and leaves
credentials persisted in the checkout step. Replace the mutable tags `@v5` for
actions/checkout and `@v2` for millionco/react-doctor with pinned commit SHAs to
lock these dependencies to specific versions. Additionally, add
`persist-credentials: false` as a configuration option to the actions/checkout
action to disable credential persistence and prevent unnecessary exposure of the
workflow token to subsequent steps.

Source: Linters/SAST tools

@ametel01

Copy link
Copy Markdown
Owner Author

Closing this stale PR as part of cleanup.

@ametel01 ametel01 closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant