Skip to content

Commit a1f0d42

Browse files
authored
repokitteh: Print docs link (envoyproxy#20970)
- in response to /docs command - for any PR that has a prefix of `docs:` Signed-off-by: Ryan Northey <[email protected]>
1 parent ef08b1c commit a1f0d42

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

ci/repokitteh/modules/docs.star

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
DOCS_LINK_MESSAGE = """
3+
4+
Docs for this Pull Request will be rendered here:
5+
6+
https://storage.googleapis.com/envoy-pr/%s/docs/index.html
7+
8+
The docs are (re-)rendered each time the CI `envoy-presubmit (precheck docs)` job completes.
9+
10+
"""
11+
12+
def should_add_docs_link(action, issue_title):
13+
return (
14+
action == 'opened'
15+
and issue_title.startswith("docs:"))
16+
17+
def add_docs_link(issue_number):
18+
github.issue_create_comment(DOCS_LINK_MESSAGE % issue_number)
19+
20+
def _pr(action, issue_number, issue_title):
21+
if should_add_docs_link(action, issue_title):
22+
add_docs_link(issue_number)
23+
24+
def _add_docs(issue_number):
25+
add_docs_link(issue_number)
26+
27+
handlers.pull_request(func=_pr)
28+
handlers.command(name='docs', func=_add_docs)

repokitteh.star

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use("github.com/repokitteh/modules/assign.star")
44
use("github.com/repokitteh/modules/review.star")
55
use("github.com/repokitteh/modules/wait.star")
66
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/azure_pipelines.star", secret_token=get_secret('azp_token'))
7+
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/docs.star")
78
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/newpr.star")
89
use(
910
"github.com/envoyproxy/envoy/ci/repokitteh/modules/ownerscheck.star",

0 commit comments

Comments
 (0)