ci: gate prs on approved linked issues#138
Merged
Merged
Conversation
hashiiiii
marked this pull request as ready for review
July 14, 2026 22:53
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
pr-issue-gateworkflow: PRs without anapprovedlinked issue get an issue-first guidance comment from unidog-bot and are converted to draft.Motivation
PrefabLens is pre-1.0; CONTRIBUTING (#54) states the issue-first policy, and this workflow enforces it reactively — PR creation itself cannot be blocked on GitHub. Gate passes when a
Closes #NNN-linked issue in this repository (or the PR itself, as a maintainer escape hatch) carries theapprovedlabel. The owner,renovate[bot], andunidog-bot[bot]are exempt.Merge after #54 — the bot comment links to
CONTRIBUTING.mdonmain, which #54 introduces.Changes
.github/workflows/pr-issue-gate.yml:pull_request_target(opened/reopened/ready_for_review/edited), no PR code checkout, unidog-bot App token for all API calls; sticky marker comment (bot-authored only) +convertPullRequestToDraft; per-PRconcurrencygroup; cross-repoCloseslinks are ignored (a contributor could self-applyapprovedin a repo they own);workflow_dispatchentry for E2E testing (OWNER PRs are exempt from the real trigger).approvedlabel (repo settings, not in this diff).Testing
ruby -ryamlparses the workflow; extractedrunscript passesbash -n.approvedissue →true; cross-repoapprovedissue →false; empty references →false.approvedon a linked scratch issue → dispatch → expect pass. Results will be posted in this PR.convertPullRequestToDraftmay fail for App tokens (Change of DRAF state of Pull Request not possible over graphql actions/toolkit#1165 documents it for GITHUB_TOKEN). The E2E run settles it; fallback is a classic PAT for the draft call only.