Skip to content

fix(ci): push date-bump commits via a bypass-eligible PAT - #50

Merged
tristantelleb merged 1 commit into
mainfrom
fix/update-dates-pat
May 22, 2026
Merged

fix(ci): push date-bump commits via a bypass-eligible PAT#50
tristantelleb merged 1 commit into
mainfrom
fix/update-dates-pat

Conversation

@tristantelleb

@tristantelleb tristantelleb commented May 21, 2026

Copy link
Copy Markdown
Member

Why

The Update Schema Dates workflow has been failing on PRs whose dateModified actually 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)

  1. Generate a fine-grained PAT under an account with Maintain/Admin on `edenai/docs`, scope `Contents: Write`, no expiration (or rotate).
  2. Add it as repo secret `DOCS_BOT_PAT` at https://github.com/edenai/docs/settings/secrets/actions.
  3. Next PR with a stale `dateModified` should auto-bump cleanly.

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

  • Chores
    • Updated workflow authentication configuration to support conditional token fallback, improving automation flexibility.

Review Change Stack

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>
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: edcb3e05-dd97-4347-b4ba-9a88b3697f5c

📥 Commits

Reviewing files that changed from the base of the PR and between 92f7521 and b42dc46.

📒 Files selected for processing (1)
  • .github/workflows/update-dates.yml

Walkthrough

The actions/checkout step in the update-dates workflow now conditionally uses a bot PAT token when available, falling back to the standard GitHub token for authentication.

Changes

GitHub Workflow Authentication

Layer / File(s) Summary
Checkout authentication token fallback
.github/workflows/update-dates.yml
The checkout step now prefers DOCS_BOT_PAT secret when available (enabling bypass-eligible pushes) and falls back to GITHUB_TOKEN when the PAT secret is not set.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A token of trust, now truly wise,
When secrets are found, we bypass with pride—
Or gentle fallback, no need to fret,
A single step springs our workflow ballet.
—The CodeRabbit

🚥 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 directly and specifically describes the main change: updating the CI workflow to use a bypass-eligible PAT for pushing date-bump commits instead of GITHUB_TOKEN.
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 fix/update-dates-pat

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.

@mintlify

mintlify Bot commented May 21, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
edenai 🟢 Ready View Preview May 21, 2026, 2:38 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@tristantelleb
tristantelleb merged commit 1776283 into main May 22, 2026
4 checks passed
@tristantelleb
tristantelleb deleted the fix/update-dates-pat branch June 8, 2026 07:52
FahimaGold added a commit that referenced this pull request Jul 27, 2026
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.
FahimaGold added a commit that referenced this pull request Jul 27, 2026
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.
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