create-pull-request: keep branch push on protected-files fallback; reserve push-failed issue for real push errors#33840
create-pull-request: keep branch push on protected-files fallback; reserve push-failed issue for real push errors#33840Copilot wants to merge 9 commits into
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes protected-files: fallback-to-issue behavior in create-pull-request so that branch push is still attempted (yielding a GitHub compare surface when successful), and so that the “push failed” fallback template is used only when an actual push error occurs.
Changes:
- Removes the “skip push” behavior previously triggered by protected-files fallback in both bundle and patch transport paths.
- Adjusts fallback issue template semantics: compare-url template on successful push; push-failed template only on real push errors.
- Updates protected-files fallback tests to assert push attempts and compare URL presence; updates generated workflow lock file.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/create_pull_request.cjs | Removes protected-files fallback push short-circuit; refactors push error handling to distinguish real push failures from protected-files fallback. |
| actions/setup/js/create_pull_request.test.cjs | Updates protected-files fallback tests to assert branch push occurs and compare URL is included in the review issue body. |
| .github/workflows/pr-code-quality-reviewer.lock.yml | Regenerated lock workflow output reflecting updated compiled template/import set. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
| if (!fallbackAsIssue) { | ||
| const error = `Failed to push changes: ${pushError instanceof Error ? pushError.message : String(pushError)}`; | ||
| return { success: false, error, error_type: "push_failed" }; | ||
| } |
| } catch (pushError) { | ||
| // Push failed - create fallback issue instead of PR (if fallback is enabled) | ||
| core.error(`Git push failed: ${pushError instanceof Error ? pushError.message : String(pushError)}`); | ||
|
|
||
| if (manifestProtectionFallback) { | ||
| // Push failed specifically for a protected-file modification. Don't create | ||
| // a generic push-failed issue — fall through to the manifestProtectionFallback |
|
``
|
|
@copilot merge main and recompile , lint go |
…es-fallback-issue Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in |
|
@copilot merge main and recompile |
…es-fallback-issue Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in |
|
@copilot merge main and recompile |
…es-fallback-issue # Conflicts: # .github/workflows/ai-moderator.lock.yml # .github/workflows/changeset.lock.yml # .github/workflows/codex-github-remote-mcp-test.lock.yml # .github/workflows/daily-cache-strategy-analyzer.lock.yml # .github/workflows/daily-fact.lock.yml # .github/workflows/daily-observability-report.lock.yml # .github/workflows/duplicate-code-detector.lock.yml # .github/workflows/grumpy-reviewer.lock.yml # .github/workflows/issue-arborist.lock.yml # .github/workflows/necromancer.lock.yml # .github/workflows/schema-feature-coverage.lock.yml # .github/workflows/smoke-call-workflow.lock.yml # .github/workflows/smoke-codex.lock.yml # pkg/workflow/testdata/TestWasmGolden_AllEngines/codex.golden Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in |
|
@copilot do a security review for agentic threats of this approach |
Security review of this approach (push even in
Recommended guardrails:
|
With
protected-files: fallback-to-issueand defaultpatch-format: bundle, the flow treated fallback as an implicit push failure, skipped branch push, and generated the push-failed issue template (no branch/compare link). This change makes fallback-to-issue preserve branch push behavior and only use push-failed messaging when push actually fails.Behavioral fix: push is no longer short-circuited by protected-files fallback
manifestProtectionFallback-based skip in both transport paths:git am) pathTemplate selection semantics corrected
manifest_protection_create_pr_fallback.md(compare URL path) is now the normal fallback when push succeeds.manifest_protection_push_failed_fallback.mdis now used only for actual push errors (permission/rejection/etc.), via existing error handling.Focused test expectation updates
gh run download/git aminstructions are not used on successful pushpr-sous-chef: requested branch update (run id: 26252608888).