Skip to content

feat(session-flow): suggest /export at session-end moments (0.34.0) #7895

feat(session-flow): suggest /export at session-end moments (0.34.0)

feat(session-flow): suggest /export at session-end moments (0.34.0) #7895

name: pr-issue-linkage
# Validates the PR body carries a native closing keyword (Closes/Fixes/Resolves
# #N, including owner/repo#N, or a no-issue marker when the PR closes nothing —
# a case-insensitive regex matching the phrase "no linked issue" or "no related
# issue", not a literal string) and four non-empty contract sections —
# `## Summary`, `## Fix`, `## Verification`, `## Related` — via the shared
# pr-issue-linkage reusable from ci-workflows. Both body scans run with fenced
# code blocks and any 4-space- or tab-indented line blanked, inline code spans
# masked, and HTML-commented text discarded, so a marker inside a fence, an
# indented line, or a comment does not count.
# `pull_request_target` runs the base-branch definition, so a head-branch edit
# cannot bypass the gate — safe here because no head-branch code ever executes:
# the pinned reusable checks out nothing, holds read-only pull-request/actions
# permissions only, and passes the body into its script step through
# env/GITHUB_ENV rather than splicing it into script text. The reusable reads
# the body via a live `gh api` re-fetch, falling back to the event payload if
# that call fails; at the pinned SHA no token reaches that step, so the re-fetch
# fails auth every time and the payload fallback is the path that actually runs
# — payload-only in effect as a side effect of the failed re-fetch, not by
# design. `edited` re-validates on a body edit. `merge_group` reports the check
# green in the queue (the body was validated at PR time; inert without a queue).
# The emitted required-check context is `pr-issue-linkage / pr-issue-linkage`.
# Public repo: GitHub-hosted runners are free here, and the `with:` block pins
# `runner: ubuntu-24.04` explicitly, which coincides with the reusable's
# default.
on:
# zizmor: ignore[dangerous-triggers] metadata-only gate; rationale in the header comment
pull_request_target:
types: [opened, edited, reopened, synchronize]
merge_group:
permissions: {}
# pull_request_target runs the base-branch definition, so github.ref is the base
# branch: the PR number scopes cancellation and github.ref covers merge_group
# (which carries no pull_request object); the fallback is inert without a queue.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pr-issue-linkage:
permissions:
pull-requests: read
actions: read
uses: melodic-software/ci-workflows/.github/workflows/pr-issue-linkage.yml@7107b34832a7b6db5d08d3b132621c599fbe5e50 # v0.14.2
with:
runner: ubuntu-24.04
# dependabot PR bodies cannot carry the closing keyword + four contract
# sections this gate requires; exempt the login so its PRs are mergeable.
exempt-authors: 'dependabot[bot]'