Skip to content

Cross-repo push-to-pull-request-branch doesn't have access to correct repo contents #19219

Description

@dsyme

In this run the push-to-pull-request-branch is not able to easily work on the right pull request.

Note it's a schedule job so the repo context Git history is definitey not set up to allow working on the pull request - the Git history for checkout: will only have main

checkout:
  - repository: githubnext/gh-aw-side-repo
    token: ${{ secrets.GH_AW_SIDE_REPO_PAT }}

https://github.com/github/gh-aw/actions/runs/22577183185/job/65399412001

We should add options to checkout: to

  1. fetch all branches (fetch: ["*"] ), or
  2. fetch all branches for all open pull requests (fetch: ["pulls/open/*"] - a special GH-AW way of saying all open PRs)
  3. fetch specific branches by pattern e.g. fetch: ["main", "feature/*"]
  4. fetch specific branches e.g. fetch: ["main", "feature/auto-perf"]

We should also extend the following prompting to be clearer about (1) what fetch-depth the checkouts have and (2) what branches are available and (3) say that if an existing branch you want to work from isn't available and it's a private repository then you won't be able to access the Git history of that branch properly, and you should probably exit with an error.

- **checkouts**: The following repositories have been checked out and are available in the workspace:
  - `$GITHUB_WORKSPACE` → `githubnext/gh-aw-side-repo` (cwd)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions