ci: require a #openab-pty Discord discussion link on community PRs - #51
Merged
Merged
Conversation
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.
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.
Same rule as openabdev/openab (
pr-discussion-check.yml+close-stale-prs.yml):closing-soonlabel 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.Differences from openab, because this repo lacks what they need:
GITHUB_TOKENinstead of the GitHub App token, since there is noAPP_ID/APP_PRIVATE_KEYhere.openabdev/openab-maintainersteam membership, since no team is attached andGITHUB_TOKENcannot read org teams.pull_request_targetis 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_URLis empty for now, so anydiscord.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, thediscordappdomain, an invite link.The
closing-soonlabel was created in this repo.