From 8bf39ab47777a1596b504728eb133820ecb18af3 Mon Sep 17 00:00:00 2001 From: phlax Date: Thu, 2 Mar 2023 15:53:04 +0000 Subject: [PATCH] repokitteh: Label version change PRs (#25853) Signed-off-by: Ryan Northey --- ci/repokitteh/modules/versionchange.star | 23 +++++++++++++++++++++++ repokitteh.star | 1 + 2 files changed, 24 insertions(+) create mode 100644 ci/repokitteh/modules/versionchange.star diff --git a/ci/repokitteh/modules/versionchange.star b/ci/repokitteh/modules/versionchange.star new file mode 100644 index 000000000000..53fc4bd4fe72 --- /dev/null +++ b/ci/repokitteh/modules/versionchange.star @@ -0,0 +1,23 @@ +# Flags when a Pull request makes changes to VERSION.txt +# +# use("github.com/repokitteh/modules/versionchange.star") +# + +load("text", "match") + +# TODO(phlax): put this in config +VERSION_CHANGE_LABEL = "version-change" + + +def _check_version_changes(): + matched = [f for f in github.pr_list_files() if match("VERSION.txt", f['filename'])] + if matched: + github.issue_label(VERSION_CHANGE_LABEL) + + +def _pr(action): + if action in ['synchronize', 'opened']: + _check_version_changes() + + +handlers.pull_request(func=_pr) diff --git a/repokitteh.star b/repokitteh.star index 4cceaf5db504..5d7b55d6af3b 100644 --- a/repokitteh.star +++ b/repokitteh.star @@ -50,6 +50,7 @@ use( }, ], ) +use("github.com/envoyproxy/envoy/ci/repokitteh/modules/versionchange.star") alias('retest', 'retry-azp')