Skip to content

Pre triage pr#50977

Closed
shawkins wants to merge 5 commits into
keycloak:mainfrom
shawkins:pre-triage-pr
Closed

Pre triage pr#50977
shawkins wants to merge 5 commits into
keycloak:mainfrom
shawkins:pre-triage-pr

Conversation

@shawkins

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 17, 2026 12:05
@shawkins
shawkins requested a review from a team as a code owner July 17, 2026 12:05
@shawkins
shawkins enabled auto-merge (squash) July 17, 2026 12:06
@shawkins shawkins closed this Jul 17, 2026
auto-merge was automatically disabled July 17, 2026 12:07

Pull request was closed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated pre-triage validation for pull-request and commit issue links.

Changes:

  • Validates issue-link formatting, consistency, and state.
  • Posts failure comments and manages triage labels.
  • Supports a label-based validation bypass.


on:
pull_request_target:
types: [opened, edited, reopened, synchronize]
Comment on lines +14 to +16
permissions:
issues: write
pull-requests: write
FAILED=0
ERRORS=""
MARKER="<!-- pre-triage-linked-issues -->"
SKIP_LABEL="skip-issue-check"
Comment on lines +45 to +46
EXISTING_COMMENT_ID=$(gh api "repos/$REPO/issues/$PR_NUMBER/comments" \
--jq ".[] | select(.body | contains(\"$MARKER\")) | .id" | head -1 || true)
Comment on lines +148 to +151
STATE=$(printf '%s' "$ISSUE_DATA" | jq -r '.state')
if [ "$STATE" != "open" ]; then
add_error "Issue #$issue is not open (current state: $STATE)"
fi
Comment on lines +156 to +157
EXISTING_COMMENT_ID=$(gh api "repos/$REPO/issues/$PR_NUMBER/comments" \
--jq ".[] | select(.body | contains(\"$MARKER\")) | .id" | head -1 || true)
Thank you for contributing this PR. The following linked issue checks failed:
${ERRORS}

Please refer to [CONTRIBUTING.md](https://github.com/${REPO}/blob/main/CONTRIBUTING.md) for requirements."

- name: Add label
if: steps.check-linked-issues.outcome == 'failure'
run: gh pr edit "${{ github.event.pull_request.number }}" -R "$GITHUB_REPOSITORY" --add-label "action/waiting-for-author"
# --- Enforce Closes vs Resolves based on issue count ---
ISSUE_COUNT=$(printf '%s\n' "$PR_ISSUES" | grep -c '.' || true)
if [ "$ISSUE_COUNT" -eq 1 ]; then
if printf '%s\n' "$PR_BODY" | grep -qE '^Resolves #[0-9]+'; then
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.

3 participants