Skip to content

Commit 61680cc

Browse files
authored
Templating: don't check the users who posted reviews (#256)
* Templating: don't check the users who posted reviews. * Add a templating watermark. * Add noreply@github.com to the BOTS list.
1 parent 2a00254 commit 61680cc

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

templates/_templating_scripting.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@
2929
"pre-commit-ci[bot]",
3030
"app/pre-commit-ci",
3131
"app/scitools-ci",
32+
"web-flow",
3233
]
33-
TEMPLATING_HEADING = f"## [Templating]({SCITOOLS_URL}/.github/blob/main/templates)"
34+
TEMPLATING_HEADING = (
35+
"[TEMPLATING WATERMARK]: #\n\n"
36+
f"## [Templating]({SCITOOLS_URL}/.github/blob/main/templates)"
37+
)
3438

3539
_MAGIC_PREFIX = "@scitools-templating: please"
3640
MAGIC_NO_PROMPT = re.compile(rf"{_MAGIC_PREFIX} no share prompt", re.IGNORECASE)
@@ -227,9 +231,6 @@ def prompt_share(args: argparse.Namespace) -> None:
227231
# Can use a URL here for local debugging:
228232
# pr_number = "https://github.com/SciTools/iris/pull/6901"
229233

230-
# current_user = gh_json("api user")["login"]
231-
current_user = "scitools-ci" # Temporary testing patch.
232-
233234
body = gh_json(f"pr view {pr_number}", "body")["body"]
234235
if MAGIC_NO_PROMPT.search(body):
235236
print(
@@ -275,8 +276,7 @@ def post_review(review_body: str, review_type: ReviewType) -> None:
275276
existing_reviews = json.loads(check_output(shlex.split(gh_command)))
276277
reviews_to_edit = [
277278
review for review in existing_reviews
278-
if review["user"]["login"] == current_user
279-
and review["body"].startswith(TEMPLATING_HEADING)
279+
if review["body"].startswith(TEMPLATING_HEADING)
280280
]
281281
if reviews_to_edit:
282282
# Edit the last existing review.

0 commit comments

Comments
 (0)