Skip to content

docs: Add CI/webhook integration guide for stack PRs#67

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-docs-stack-details
Draft

docs: Add CI/webhook integration guide for stack PRs#67
Copilot wants to merge 2 commits intomainfrom
copilot/update-docs-stack-details

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

pull_request webhook events now include a stack object for PRs that belong to a stack. Without documentation, teams can't easily discover how to use stack.base.ref to trigger CI on every PR in a stack targeting main — not just the bottom PR that directly targets main.

Changes

  • New guide docs/src/content/docs/guides/ci-integration.md:

    • Documents the stack object shape in pull_request webhook payloads
    • Distinguishes pull_request.base.ref (direct PR base) from pull_request.stack.base.ref (ultimate stack target)
    • GitHub Actions if condition example covering both stacked and standalone PRs
    • JavaScript and Python webhook handler snippets with safe optional chaining for non-stacked PRs
    • Use cases for stack.base.sha (drift detection, targeted git log, CI caching)
    • Reference table mapping all four PR scenarios (standalone, bottom, mid-stack, top) to their field values
  • docs/astro.config.mjs: Adds the new guide to the sidebar under Guides.

Key pattern documented

# GitHub Actions: run on any PR that ultimately targets main
if: |
  github.event.pull_request.base.ref == 'main' ||
  github.event.pull_request.stack.base.ref == 'main'
// Custom webhook handler — stack is absent for standalone PRs
const targetsMain =
  pr.base.ref === 'main' || pr.stack?.base?.ref === 'main';

…hook events

Agent-Logs-Url: https://github.com/github/gh-stack/sessions/cf10db22-af0b-45c3-95d6-de9ef313d624

Co-authored-by: willsmythe <2503052+willsmythe@users.noreply.github.com>
Copilot AI changed the title [WIP] Update docs with stack details in pull request webhook event docs: Add CI/webhook integration guide for stack PRs Apr 24, 2026
Copilot AI requested a review from willsmythe April 24, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs with details about stack details in pull_request webhook event

2 participants