Add CI workflow to validate website files#40
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR introduces a new GitHub Actions CI workflow that validates the website structure. The workflow triggers on pull requests and pushes to the main branch, running a single validation job that confirms required files (index.html and style.css) exist before reporting successful completion. ChangesCI Website Validation Workflow
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
16-20: ⚡ Quick winAdd descriptive error messages for missing files.
The
test -fcommand fails silently without indicating which file is missing. Adding explicit error messages improves the developer experience when the workflow fails.💬 Proposed improvement with better error messages
- name: Check HTML exists - run: test -f index.html + run: test -f index.html || { echo "Error: index.html not found"; exit 1; } - name: Check CSS exists - run: test -f style.css + run: test -f style.css || { echo "Error: style.css not found"; exit 1; }🤖 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/ci.yml around lines 16 - 20, The workflow steps "Check HTML exists" and "Check CSS exists" use silent `test -f` checks; update their run commands to detect missing files and print clear error messages (including the filename and context) and exit non-zero so the job fails visibly. Specifically, replace the current `test -f` invocations in the "Check HTML exists" and "Check CSS exists" steps with a shell snippet that checks for the file (index.html and style.css respectively), echoes a descriptive error to stderr if it's missing (e.g., "index.html is missing: ensure build produced it"), and exits with a non-zero status.
🤖 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/ci.yml:
- Line 14: Replace the floating actions/checkout@v4 usage with a pinned commit
SHA and disable credential persistence: update the workflow step that currently
says uses: actions/checkout@v4 to use a specific commit SHA
(actions/checkout@<full-commit-sha>) and add the with: persist-credentials:
false option so the checkout step does not leave credentials in the runner.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 16-20: The workflow steps "Check HTML exists" and "Check CSS
exists" use silent `test -f` checks; update their run commands to detect missing
files and print clear error messages (including the filename and context) and
exit non-zero so the job fails visibly. Specifically, replace the current `test
-f` invocations in the "Check HTML exists" and "Check CSS exists" steps with a
shell snippet that checks for the file (index.html and style.css respectively),
echoes a descriptive error to stderr if it's missing (e.g., "index.html is
missing: ensure build produced it"), and exits with a non-zero status.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Added Workflow
Summary by CodeRabbit