-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repokitteh: Print docs link (#20970)
- in response to /docs command - for any PR that has a prefix of `docs:` Signed-off-by: Ryan Northey <[email protected]>
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
DOCS_LINK_MESSAGE = """ | ||
Docs for this Pull Request will be rendered here: | ||
https://storage.googleapis.com/envoy-pr/%s/docs/index.html | ||
The docs are (re-)rendered each time the CI `envoy-presubmit (precheck docs)` job completes. | ||
""" | ||
|
||
def should_add_docs_link(action, issue_title): | ||
return ( | ||
action == 'opened' | ||
and issue_title.startswith("docs:")) | ||
|
||
def add_docs_link(issue_number): | ||
github.issue_create_comment(DOCS_LINK_MESSAGE % issue_number) | ||
|
||
def _pr(action, issue_number, issue_title): | ||
if should_add_docs_link(action, issue_title): | ||
add_docs_link(issue_number) | ||
|
||
def _add_docs(issue_number): | ||
add_docs_link(issue_number) | ||
|
||
handlers.pull_request(func=_pr) | ||
handlers.command(name='docs', func=_add_docs) |
This file contains 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