-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Refactor deployment to not modify source file #25
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
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughAdded repository maintenance docs, removed a path filter so PR validation runs on all PRs, and added a post-deploy step that resets and commits the token list timestamp to main as part of the deploy workflow. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
Greptile SummaryThis PR adds a "Repository Maintenance" section to the README documenting the special branch protection configuration that allows GitHub Actions to bypass PR requirements and push directly to
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant PR as Pull Request
participant Main as Main Branch
participant Release as GitHub Release
participant Actions as GitHub Actions
participant Pages as GitHub Pages
Dev->>PR: Create PR with token changes
PR->>Main: Merge (requires 1 approval)
Dev->>Release: Create GitHub Release
Release->>Actions: Trigger deploy workflow
Actions->>Main: Checkout main branch
Actions->>Actions: Validate token list
Actions->>Main: Push commit (update timestamp) [bypass PR requirement]
Actions->>Main: Push commit (create version snapshot) [bypass PR requirement]
Actions->>Pages: Deploy versioned files
|
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Always run validation on PRs to ensure required status check reports. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
After deployment, reset the timestamp in token-list.json back to the placeholder value. This ensures future PRs pass validation, since the validation script expects the placeholder (not a real timestamp). The deployed files on GitHub Pages retain the real timestamp. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Deployment now creates timestamped copies in dist/ without modifying the source file - Reset timestamp to placeholder so validation passes on future PRs - Historical snapshots in versions/ still have real timestamps - Reduces commit noise (no more timestamp update commits on every deploy) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/deploy.yml:
- Around line 168-178: The "Reset timestamp to placeholder" workflow step should
be made resilient by running regardless of deploy success (set the step's if to
always() or use post job cleanup semantics) and by avoiding empty commits: after
writing tokens/token-list.json.tmp and moving it into place, check for actual
repo changes (e.g., using git status --porcelain or git diff --quiet) before
running git add/commit/push; only run HUSKY=0 git commit -m "chore: Reset
timestamp to placeholder [skip ci]" and git push origin main when changes exist
to prevent failing on empty commits. Ensure the step still configures git
user.email/name and references the tokens/token-list.json target file exactly.
Problem
tokens/token-list.jsonon every deploy, creating 2 commits per release (timestamp update + historical snapshot) and triggering unnecessary notificationsProposed Solution
Deployment Workflow Refactor
dist/without modifying the source filetokens/token-list.jsonalways keeps the placeholder timestampversions/retain their original timestamps (not updated on subsequent deploys)Branch Protection
github-actionsapp to bypass PR requirements for the historical snapshot commitvalidateas a required status checkPR Validation
validatealways runs (required for status checks to work properly)Changes
.github/workflows/deploy.yml- Refactored to timestamp copies in dist/, not source.github/workflows/pr.yml- Remove path filterstokens/token-list.json- Reset timestamp to placeholderREADME.md- Document branch protection settings🤖 Generated with Claude Code