Skip to content

Action fails on when PR's base ref exists as a branch but not a PR #36

@tranhl

Description

@tranhl

Given this branch stack, with no PRs created for any branch:

  • main
    • parent-branch
      • child-branch

If a PR is created for child-branch, the action will fail be because parent-branch does not have an associated PR. This happens because the action uses the repo's pull requests when building up the stack graph. To fix this, we should first add all branches in the repository as nodes on the graph, even if they don't appear in PRs, so that leafs can be properly connected when iterating through the pull requests.

Is also related to #34, as we will need to handle pagination to make sure that we have a full list of branches for the repository. This doesn't scale very well for large repositories (e.g. monorepos), but it's better than the action failing and not producing a branch stack at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions