Skip to content

Commit 57d3191

Browse files
authored
allow ignoring contributors by email for the release notes (#10814)
* allow ignoring by email * add more email addresses for the AI agent Claude
1 parent badb6f1 commit 57d3191

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

ci/release_contributors.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@
77
co_author_re = re.compile(r"Co-authored-by: (?P<name>[^<]+?) <(?P<email>.+)>")
88

99

10+
ignored = [
11+
{"name": "dependabot[bot]"},
12+
{"name": "pre-commit-ci[bot]"},
13+
{
14+
"name": "Claude",
15+
"email": [
16+
"noreply@anthropic.com",
17+
"claude@anthropic.com",
18+
"no-reply@anthropic.com",
19+
],
20+
},
21+
]
22+
23+
24+
def is_ignored(name, email):
25+
# linear search, for now
26+
for ignore in ignored:
27+
if ignore["name"] != name:
28+
continue
29+
ignored_email = ignore.get("email")
30+
if ignored_email is None or email in ignored_email:
31+
return True
32+
33+
return False
34+
35+
1036
def main():
1137
repo = git.Repo(".")
1238

@@ -22,11 +48,8 @@ def main():
2248

2349
# deduplicate and ignore
2450
# TODO: extract ignores from .github/release.yml
25-
ignored = ["dependabot", "pre-commit-ci"]
2651
unique_contributors = unique(
27-
contributor
28-
for contributor in contributors.values()
29-
if contributor.removesuffix("[bot]") not in ignored
52+
name for email, name in contributors.items() if not is_ignored(name, email)
3053
)
3154

3255
sorted_ = sorted(unique_contributors)

0 commit comments

Comments
 (0)