Skip to content

Commit 9745999

Browse files
authored
chore: skip bot accounts in office hours script (hiero-ledger#1403)
Signed-off-by: Dominiq Barbero <mr.dom.barbero@gmail.com>
1 parent 933d08c commit 9745999

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/scripts/bot-office-hours.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,19 @@ EOF
8484

8585
echo "$PR_DATA" |
8686
jq -r '
87-
group_by(.author.login)
87+
sort_by(.author.login)
88+
| group_by(.author.login)
8889
| .[]
89-
| sort_by(.createdAt)
90-
| reverse
91-
| .[0]
92-
| "\(.number) \(.author.login)"
90+
| max_by(.createdAt)
91+
| ((.author.login | endswith("[bot]")) as $is_bot
92+
| "\(.number) \(.author.login) \($is_bot)"
9393
' |
94-
while read PR_NUM AUTHOR; do
94+
while read -r PR_NUM AUTHOR IS_BOT; do
95+
if [[ "$IS_BOT" == "true" ]]; then
96+
echo "Skipping PR #$PR_NUM because author @$AUTHOR is a bot."
97+
continue
98+
fi
99+
95100
for EXCLUDED in "${EXCLUDED_AUTHORS[@]}"; do
96101
if [ "$AUTHOR" = "$EXCLUDED" ]; then
97102
echo "Skipping PR #$PR_NUM by excluded author @$AUTHOR"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
156156

157157
- Updated `pyproject.toml` to enforce stricter Ruff linting rules, including Google-style docstrings (`D`), import sorting (`I`), and modern Python syntax (`UP`).
158158
- Modified and renamed hasIntermediateOrAdvancedLabel() to check if issue label is beginner or higher (#1385)
159+
- Updated `.github/scripts/bot-office-hours.sh` to detect and skip PRs created by bot accounts when posting office hours reminders. (#1384)
159160

160161
### Fixed
161162
- Good First Issue bot no longer posts `/assign` reminders for repository collaborators. (#1367)

0 commit comments

Comments
 (0)