Skip to main content

Expose GitHub stacked PR data in push policy

Stacked PRs are a relatively new feature in GitHub (and other forges). GitHub exposes the stack information as a stack property on the pull_request object:

% gh api repos/example/repository/pulls/1000 --jq '{number, state, base: .base.ref, head: .head.ref, stack}'
{
  "base": "main",
  "head": "jj-stack/my-cool-branch",
  "number": 1000,
  "stack": {
    "base": {
      "ref": "main",
      "sha": "529290e92c9b48aa5c6f187fed2522ad9ba5a2ee"
    },
    "id": 3077290,
    "number": 1030,
    "position": 1,
    "size": 30
  },
  "state": "open"
}
Workaround
Problem

Log in to comment and vote

No comments yet

Be the first to share your thoughts.