Skip to content

fix: open PR instead of pushing direct to satisfy default-branch protection#18

Open
Gumbees wants to merge 1 commit into
developmentfrom
bug/sbom-workflow-pr-mode
Open

fix: open PR instead of pushing direct to satisfy default-branch protection#18
Gumbees wants to merge 1 commit into
developmentfrom
bug/sbom-workflow-pr-mode

Conversation

@Gumbees
Copy link
Copy Markdown
Collaborator

@Gumbees Gumbees commented May 22, 2026

What

Swap stefanzweifel/git-auto-commit-action@v5 for peter-evans/create-pull-request@v6 in .github/workflows/generate-artifacts.yml. The workflow now opens a PR titled chore: regenerate SBOM and STRUCTURE against the triggering branch instead of pushing direct.

Why

The org-level Default Branch Protection ruleset (id 15744970, created 2026-04-29) requires all changes to the default branch to come via PR. The previous direct-push step was rejected on every run since 2026-04-26 with:

remote: error: GH006: Protected branch update failed for refs/heads/development.

This left Generate Repo Artifacts red on five consecutive runs and would bite every other BR repo as the same workflow rolls out fleet-wide.

How

  • peter-evans/create-pull-request@v6 opens a PR from a stable feature branch (chore/regenerate-artifacts) with delete-branch: true to keep the branch list clean
  • add-paths narrows the diff to exactly SBOM.md and STRUCTURE.md
  • Workflow now requests pull-requests: write in addition to contents: write
  • Auto-merge has been enabled on the repo via gh repo edit --enable-auto-merge
  • The PR title and commit message keep the same chore: prefix; the prior [skip ci] is gone because there's no longer a direct push to skip

Friction left

The org ruleset still requires 1 approving review on default-branch PRs. The existing OrganizationAdmin bypass entry with bypass_mode: pull_request means Nate can approve+merge his own PRs in one click, so each regen needs one click. True zero-touch needs a dedicated GitHub App with bypass ... tracked as a follow-up (option C from issue #14).

Closes

Related

  • Workflow rolls out across BR repos per DevOps book; this PR pattern is the right replacement everywhere
  • CLAUDE.md:94 ("development is the default branch, direct pushes allowed") is now stale doc ... will file a separate docs-drift issue

…ection

The org-level Default Branch Protection ruleset (created 2026-04-29) requires
all changes to the default branch to land via PR. The previous
`stefanzweifel/git-auto-commit-action@v5` step tried to push the regenerated
SBOM/STRUCTURE files directly to `development`, got rejected with GH006, and
left the Generate Repo Artifacts workflow red on every run since 2026-04-26.

Switch to `peter-evans/create-pull-request@v6`. The workflow now opens a PR
titled "chore: regenerate SBOM and STRUCTURE" against the triggering branch.
Auto-merge has been enabled on the repo; org admins can approve+merge the PR
in one click via the existing OrganizationAdmin bypass entry.

Adds `pull-requests: write` to the workflow's permissions.

Closes #14.
@Gumbees Gumbees added type:problem Halo-equiv ticket type: something broken or wrong category:bug Implementation mistake (wrong execution of correct intent) labels May 22, 2026
@Gumbees Gumbees enabled auto-merge (squash) May 22, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:bug Implementation mistake (wrong execution of correct intent) type:problem Halo-equiv ticket type: something broken or wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant