Skip to content

Commit 173a357

Browse files
committed
Update generate_release_notes.py
1 parent 1e4b572 commit 173a357

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/scripts/generate_release_notes.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,31 @@ def fetch_commits():
4646
return commits
4747

4848
def is_bot_commit(commit):
49-
# Check if commit author or committer is a known bot
49+
# Same as before, skip commits by known bots (dependabot, etc.)
5050
author = commit.get('author')
5151
commit_author_name = commit['commit']['author']['name'].lower() if commit['commit']['author']['name'] else ''
52-
# author may be None or dict with 'login' key
5352
author_login = author.get('login', '').lower() if author else ''
54-
5553
bot_indicators = ['bot', 'dependabot', 'actions-user']
56-
57-
# Check login and commit author name for bot keywords
5854
if any(bot_name in author_login for bot_name in bot_indicators):
5955
return True
6056
if any(bot_name in commit_author_name for bot_name in bot_indicators):
6157
return True
6258

59+
# Also skip commits with messages indicating package bumps or updates
60+
message = commit['commit']['message'].lower()
61+
62+
# Regex pattern for package bump PR commits, e.g., "📦 bump package from x to y (#1234)"
63+
bump_pattern = re.compile(r'📦 bump .* from .* to .* #\d+', re.IGNORECASE)
64+
65+
# Check message for bump pattern or "applying package updates"
66+
if bump_pattern.search(message):
67+
return True
68+
if 'applying package updates' in message:
69+
return True
70+
if 'no_ci' in message or 'no ci' in message:
71+
# if the commit says NO_CI, likely an auto-update
72+
return True
73+
6374
return False
6475

6576
def filter_commits_by_date(commits):

0 commit comments

Comments
 (0)