Skip to content

Issue: Error when using safe_output.push_to_pull_request_branch #21436

Open

Description

@TiggySravan

I’m encountering an error whenever I try to use safe_output.push_to_pull_request_branch:

push_to_pull_request_branch
  └ {"result":"error","error":"Cannot generate incremental patch: failed to fetch..."}

I’m not sure whether this is a bug or if I’m missing some configuration. Could you please take a look?

Steps to Reproduce

Set up a workflow that is automatically triggered on CI when a pull request is opened or synchronized against the default branch (e.g., main), with path filters applied.

Configure the workflow similar to the following:

safe-outputs:
  github-app:
    app-id: ${{ vars.APP_ID }}
    private-key: ${{ secrets.APP_PRIVATE_KEY }}
  push-to-pull-request-branch:
    max: 3

Define and run the Agentic Workflow that attempts to push changes back to the pull request branch.

Observed Behavior

The workflow fails with:

Cannot generate incremental patch: failed to fetch...
Expected Behavior

The action should successfully generate and push incremental changes to the pull request branch.

Activity

  1. TiggySravan commented on Mar 17, 2026

    @TiggySravan
    Author

    Files Committed to PR Branch
    ⚠️ The automated push to the PR branch failed due to HTTPS authentication restrictions in the workflow runner. The following changes were built and committed locally but could not be pushed automatically:

    Error message from the Output

  2. locked and limited conversation to collaborators on Mar 17, 2026
  3. unlocked this conversation on Mar 17, 2026
  4. locked and limited conversation to collaborators on Mar 17, 2026
  5. unlocked this conversation on Mar 17, 2026
  6. pelikhan commented on Mar 17, 2026

    @pelikhan
    Collaborator

    Open your favorite agent cli, load our agentic-workflows agent and ask it to debug the workflow run url

  7. TiggySravan commented on Mar 18, 2026

    @TiggySravan
    Author

    Thanks! That's the first thing i did, when i had this issue. Have got not much out of that from debugging workflow runs!

  8. locked and limited conversation to collaborators on Mar 18, 2026
  9. unlocked this conversation on Mar 18, 2026
  10. pelikhan commented on Oct 7, 2026

    @pelikhan
    Collaborator

    Status (2026-10-07; Needs progress check): The March 17 report says push-to-pull-request-branch failed while fetching an incremental patch, and a follow-up described HTTPS authentication restrictions; the March 18 reply said workflow-run debugging had not clarified the cause. The issue is open and needs a progress check using a relevant run’s fetch diagnostics and checkout credentials before identifying a fix.

  11. added
    bug
    cluster:git-correctness
    on Oct 14, 2026
  12. pelikhan commented on Oct 16, 2026

    @pelikhan
    Collaborator

    Current-state refresher (2026-10-16): directly related fixes have merged; the original deployment is not yet verified. #21568 merged March 18 specifically for the reported incremental-patch fetch failure, retaining a usable checkout-time tracking ref instead of requiring a successful authenticated fetch. Later #56119 added the explicit pre-agent PR-head baseline needed for fork PRs.

    Current incremental patch generation prefers that local baseline and otherwise checks local tracking refs before a fetch. Integration coverage specifically covers fetch failure with an existing tracking ref.

    Safe-output App credentials do not imply that the agent-side MCP process has authenticated Git access. If the original workflow still fails, the discriminating evidence is whether its freshly compiled PR checkout recorded the baseline in the correct checkout, plus the precise fetch error and fork/shallow configuration. No failing run URL was supplied here and no live run was reproduced, so this is partially addressed, not proof that every original authentication failure is gone.

  13. pelikhan commented on Oct 22, 2026

    @pelikhan
    Collaborator

    Rechecked 2026-10-22 against current main (ffdd9c9): directly related fixes are merged, but the original workflow's outcome remains unverified; leaving open.

    Merged #21568 directly addressed the reported fetch failure by allowing an existing checkout-time tracking ref. Merged #56119 added the explicit pre-agent PR-head baseline for fork PRs. Current incremental patch generation prefers that baseline, then tries the local tracking ref before fetching; checkout exports its baseline SHA/ref and logs it. The broken-remote integration regression remains present. These are merged mitigations, not proof that this reporter's separate HTTPS push failure is resolved.

    Next step: obtain the original/recent failing run URL, compiled workflow/setup revision, fork/same-repository and shallow-checkout settings, and logs showing whether Recorded PR head baseline occurred in the checkout used for patch generation. Distinguish an agent-side missing-baseline/fetch failure from a trusted safe-output-job push authentication failure; the configured safe-output App token does not imply Git credentials inside the agent's MCP process. If current compiled behavior succeeds for the reported deployment, this can close as completed; otherwise use that exact failing stage for a focused fix. No live run was reproduced or dispatched.

  14. added
    backlog:safe-outputs-git
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlog:safe-outputs-gitbugcluster:git-correctnesscommunityneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions