Skip to content

Commit

Permalink
repokitteh: Print docs link (#20970)
Browse files Browse the repository at this point in the history
- in response to /docs command
- for any PR that has a prefix of `docs:`

Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax authored Apr 25, 2022
1 parent ef08b1c commit a1f0d42
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ci/repokitteh/modules/docs.star
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)
1 change: 1 addition & 0 deletions repokitteh.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use("github.com/repokitteh/modules/assign.star")
use("github.com/repokitteh/modules/review.star")
use("github.com/repokitteh/modules/wait.star")
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/azure_pipelines.star", secret_token=get_secret('azp_token'))
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/docs.star")
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/newpr.star")
use(
"github.com/envoyproxy/envoy/ci/repokitteh/modules/ownerscheck.star",
Expand Down

0 comments on commit a1f0d42

Please sign in to comment.