Skip to content

fix(ci): evidence sync opens a PR instead of pushing to main - #1016

Open
emooreatx wants to merge 1 commit into
mainfrom
fix/evidence-sync-pr
Open

fix(ci): evidence sync opens a PR instead of pushing to main#1016
emooreatx wants to merge 1 commit into
mainfrom
fix/evidence-sync-pr

Conversation

@emooreatx

Copy link
Copy Markdown
Contributor

safety-evidence-sync has been failing on every run. It harvests correctly, commits, and is then rejected at the final step:

remote: error: GH013: Repository rule violations found for refs/heads/main.
remote: - Changes must be made through a pull request.

So the evidence was gathered and discarded every time — the job's whole purpose, defeated one line from the end.

Now it commits to a fixed evidence/safety-sync branch and opens or updates a PR. The fixed branch name means repeated syncs update the same PR rather than accumulating one per run; force-push is safe because the branch is rebuilt from main each run and is owned solely by this job. An already-open PR is reused, since gh pr create errors on a duplicate and that must not fail the job.

Adds pull-requests: write.

🤖 Generated with Claude Code

https://claude.ai/code/session_018umjfoyNwpa7BWVmzoayTM

The job harvested correctly and then threw the result away on every run.
main carries a ruleset — "Changes must be made through a pull request" —
so `git push origin main` was rejected with GH013 AFTER the bundles were
gathered and committed. The failure was at the very last step, which is
why the run looked like it worked until the end.

Now commits to a fixed `evidence/safety-sync` branch and opens (or
updates) a PR. Fixed branch name, so repeated syncs update the same PR
instead of accumulating one per run; force-push is safe because the branch
is rebuilt from main each time and belongs solely to this job. Reuses an
open PR rather than letting `gh pr create` error on a duplicate.

Adds `pull-requests: write`, which the job now needs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018umjfoyNwpa7BWVmzoayTM
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2026

Copy link
Copy Markdown

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