fix: update deployment workflow and refine Vite configuration#66
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughVite config now sets a production base path "/OrgExplorer/" and the app router uses the same basename; GitHub Actions workflow simplified to Node.js 22 with ChangesBuild and Deployment Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/deploy.yml:
- Around line 12-15: The workflow-wide permissions block currently grants pages:
write and id-token: write which elevates privileges for all jobs (including
build); remove or reduce these permissions from the top-level permissions block
to the minimal defaults (e.g., only contents: read) and add a job-scoped
permissions entry to the deploy job that explicitly sets pages: write and
id-token: write (referencing the top-level permissions key and the deploy job
name) so only the deploy job has those write permissions; also apply the same
change where the duplicate permissions appear (the block referenced around lines
49-61).
- Line 27: The workflow uses tag-pinned GitHub Actions (e.g., uses:
actions/checkout@v4, actions/setup-node@v4, actions/configure-pages@v5,
actions/upload-pages-artifact@v3, actions/deploy-pages@v5); update each of those
uses: entries to the corresponding full commit SHAs instead of mutable tags.
Locate the five occurrences of actions/checkout, actions/setup-node,
actions/configure-pages, actions/upload-pages-artifact, and actions/deploy-pages
in .github/workflows/deploy.yml and replace the `@vX` tag with the verified commit
SHA from each action's repository (ensure you copy the exact full 40-character
SHA and run a quick workflow lint or dry-run to confirm validity).
In `@vite.config.js`:
- Line 7: Vite's base is set to "/OrgExplorer/" but the React Router
BrowserRouter is mounted without a basename, causing broken refresh/deep links;
update the BrowserRouter instantiation (look for BrowserRouter in src/main.jsx,
the root mount code) to pass basename="/OrgExplorer" (or derive it from
process.env or import.meta.env.BASE_URL) so the router's basename matches the
Vite base setting.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a696f411-e413-44ec-b5fa-7779ebaf83dd
📒 Files selected for processing (2)
.github/workflows/deploy.ymlvite.config.js
Additional Notes:
This PR updates the deployment workflow according to vite-react app.
Checklist
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.
Summary by CodeRabbit