fix(ci): push date-bump commits via a bypass-eligible PAT - #50
Conversation
The Update Schema Dates workflow has been silently rejected at the push step since 2026-05-11, when the org-level `agent-block` ruleset was created. github-actions[bot] writes via GITHUB_TOKEN as Write role (id=3), which is not in the ruleset's bypass list (Triage 2, Maintain 4, Admin 5). The workflow only appeared green when the script made zero changes and the push step short-circuited. Read DOCS_BOT_PAT from secrets when present so the checkout token (and the resulting push) authenticates as a user that IS in the ruleset's bypass list. Falls back to GITHUB_TOKEN so the workflow keeps running until the secret is provisioned — same broken push behavior as today, no regression. After merging, add DOCS_BOT_PAT as a repo secret pointing at a fine-grained PAT scoped to Contents:Write on edenai/docs, owned by a user with Maintain or Admin on the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe ChangesGitHub Workflow Authentication
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 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)
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 |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
The generate-features workflow has failed on every run since 2026-05-12
(76 consecutive failures). Generation itself succeeds; the create-pull-request
step is what fails, because it force-pushes as github-actions[bot] (Write role)
and the agent-block ruleset rejects create/update/force-push on every ref
outside refs/heads/edenai-assistant/**:
remote: error: GH013: Repository rule violations found
remote: - Cannot force-push to this branch
remote: - Cannot update this protected ref
Same failure and same fix as update-dates.yml (#50), which was never applied
here. Falls back to GITHUB_TOKEN so the step still runs without the secret.
The generate-features workflow has failed on every run since 2026-05-12
(76 consecutive failures). Generation itself succeeds; the create-pull-request
step is what fails, because it force-pushes as github-actions[bot] (Write role)
and the agent-block ruleset rejects create/update/force-push on every ref
outside refs/heads/edenai-assistant/**:
remote: error: GH013: Repository rule violations found
remote: - Cannot force-push to this branch
remote: - Cannot update this protected ref
Same failure and same fix as update-dates.yml (#50), which was never applied
here. Falls back to GITHUB_TOKEN so the step still runs without the secret.
Why
The Update Schema Dates workflow has been failing on PRs whose
dateModifiedactually needs a bump. Root cause: org-level ruleset `agent-block` (created 2026-05-11) blocks the bot's push.```
remote: error: GH013: Repository rule violations found
remote: - Cannot update this protected ref.
```
`github-actions[bot]` pushes via `GITHUB_TOKEN` as Write role (id=3), which is not in the ruleset's bypass list (Triage 2, Maintain 4, Admin 5). Only branches under `refs/heads/edenai-assistant/**` are excluded from the rule.
For 10 days the workflow looked green because the script kept short-circuiting at `No date updates to commit` (frontmatter already had today's date, so nothing to push). Today's PRs touched docs with stale `dateModified` values, the script made real changes, and the push step finally fired — and got rejected. Hit on both PR #49 (EU endpoint) and PR #42 (embeddings) — so the failure is independent of any particular PR's content.
What this PR does
Reads the checkout token from a new repo secret `DOCS_BOT_PAT` when available, falling back to `GITHUB_TOKEN` otherwise. The PAT must belong to a user (or GitHub App) whose role on this repo is in the bypass list — Maintain or Admin works.
Follow-up (manual, after merge)
Until step 2 happens, the workflow behaves exactly as it does today — fails on real-diff runs, passes on no-op runs. No regression.
Note on the failing `update` check on this PR
This PR's own `update` check will fail for the same reason the workflow is broken everywhere — but `update` isn't a required check, so this PR is mergeable.
🤖 Generated with Claude Code
Summary by CodeRabbit