Skip to content

ci: require a #openab-pty Discord discussion link on community PRs - #51

Merged
thepagent merged 1 commit into
mainfrom
ci/pr-discussion-check
Oct 1, 2026
Merged

thepagent merged 1 commit into
mainfrom
ci/pr-discussion-check

Conversation

@chaodu-agent

Copy link
Copy Markdown
Contributor

Same rule as openabdev/openab (pr-discussion-check.yml + close-stale-prs.yml):

  • When a community PR body has no Discord discussion URL, it gets the closing-soon label and a comment asking for a link to the #openab-pty discussion. The check fails, and the PR is auto-closed 24 h after labelling. Adding the link removes both the label and the comment.
  • Bots and maintainers (write/maintain/admin on this repo) are exempt.

Differences from openab, because this repo lacks what they need:

  • GITHUB_TOKEN instead of the GitHub App token, since there is no APP_ID/APP_PRIVATE_KEY here.
  • The maintainer exemption checks repo permission instead of openabdev/openab-maintainers team membership, since no team is attached and GITHUB_TOKEN cannot read org teams.

pull_request_target is safe here: nothing from the PR is checked out or executed, and the script only reads the PR body and author from the event.

CHANNEL_URL is empty for now, so any discord.com/channels/… link passes. Set it to the #openab-pty channel link to make the comment clickable and accept only links into that channel. Matching logic checked against 6 cases: no link, any link, a message in the channel, another channel, the discordapp domain, an invite link.

The closing-soon label was created in this repo.

Same rule as openabdev/openab: a PR without a Discord discussion URL gets the closing-soon label and a comment, and close-stale-prs.yml closes it after 24 hours. Bots and maintainers (write access to this repo) are exempt. Uses GITHUB_TOKEN and repo permission instead of openab's GitHub App and team, which this repo does not have. pull_request_target is safe here: nothing from the PR is checked out or run.
@thepagent
thepagent merged commit 905d350 into main Oct 1, 2026
6 checks passed
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.

2 participants