Skip to content

update-indexes.yaml pushes directly to a protected branch; must open a pull request #75

Closed

Description

@David-Noble-at-work

update-indexes.yaml commits generated index files straight into the protected branch that
triggered it. That push is now refused, and the workflow must open a pull request instead.

What it does today

on:
  push:
    branches: [develop, main, 'release/*']
git add -f packages/index.yaml packages/cross-reference.yaml knowledge/*/index.yaml
if git diff --staged --quiet; then
  echo "No index changes to commit"
else
  git commit -m "chore: update indexes"
  git push          # ← straight back into the branch that triggered this run
fi

Why it stopped being allowed

Organization ruleset 12426847 held both bypass actors — OrganizationAdmin and the automation
app, Integration/2791147 — at bypass_mode: always, which exempted them from every rule,
including the pull_request rule requiring a pull request at all. Direct pushes to protected
branches were therefore possible.

On 2026-08-26 both were narrowed to pull_request: an override at merge and nothing else.
Direct pushes to main, develop, and release/* are now refused for everyone. See
noblefactor-ops docs/github-branch-protection.md.

Nothing is broken today, because the workflow already fails earlier — at Update package index,
running star devlore package validate, and has since at least 2026-08-12. It never reaches the
push. The moment that earlier failure is fixed, this one surfaces.

The fix

The shape devlore-cli already uses in three workflows: commit to a generated branch, open a pull
request, merge it with --admin.

BRANCH="chore/update-indexes-${GITHUB_SHA::8}"
git checkout -b "$BRANCH"
git commit -m "chore: update indexes"
git push origin "$BRANCH"
PR_URL=$(gh pr create --base "${GITHUB_REF_NAME}" --title "chore: update indexes" --fill)
gh pr merge "$PR_URL" --admin --squash --delete-branch

knowledge-extract.yaml in devlore-cli is the closest working model, including its five-attempt
retry loop around the merge — GitHub can report a pull request as unmergeable for a few seconds
after creation while it computes mergeability.

Note the branch name must satisfy organization ruleset 12515090, which constrains branch names on
every ref with no bypass actors at all:

^(chore|doc|feature|fix|hotfix|refactor|release)/.+$

chore/ qualifies; a bare name or docs/ would be rejected at push time.

Two decisions before implementing

  1. Churn. These are generated artifacts. A pull request per push to a protected branch is a lot
    of noise. The workflow already guards with git diff --staged --quiet, so a PR only appears when
    the indexes actually change — but a scheduled run, or generating on demand rather than
    committing, may suit better.
  2. Ordering. The Update package index failure has to be fixed first, or the reworked push path
    cannot be exercised at all.

Related

  • Validate fails at the same step and for the same reason — worth fixing together.
  • devlore-cli docs/plans/platform-test-matrix.md phase 4, and the branch-protection policy above,
    record the ruleset change that makes this necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions