Skip to content

Commit 7f50918

Browse files
committed
fix: filter bot accounts from contributors list
Add automatic bot filtering to update-contributors.sh: - Skip logins ending with [bot] suffix - Skip accounts with GitHub API type "Bot" Remove duplicate pullfrog[bot] entries from contributors-list.md. Closes #3764
1 parent 1557dba commit 7f50918

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

docs/.contributorsignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Accounts with a [bot] suffix are filtered automatically by the script.
2+
# The entries below are kept as an extra safeguard.
13
dependabot-preview[bot]
24
dependabot[bot]
35
github-actions[bot]

docs/partials/contributors-list.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,4 @@
115115
- [jcx0](https://github.com/jcx0)
116116
- [maxdew-envelio](https://github.com/maxdew-envelio)
117117
- [nnzhadow](https://github.com/nnzhadow)
118-
- [pullfrog[bot]](https://github.com/pullfrog[bot])
119-
- [pullfrog[bot]](https://github.com/pullfrog[bot])
120118
- [renoschubert](https://github.com/renoschubert)

scripts/update-contributors.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ while :; do
6969
jq -r '.[].author | select(.login != null) | .login' "$TMP_JSON" | sort -u > "$TMP_LOGINS"
7070

7171
while read -r login; do
72+
if [[ "$login" == *"[bot]" ]]; then
73+
continue
74+
fi
75+
7276
if ! grep -Fxq "$login" "$EXCLUDED_FILE"; then
7377
if ! printf '%s\n' "${USERS[@]}" | grep -qx "$login"; then
74-
USERS+=("$login")
75-
7678
CACHE_FILE="$CACHE_DIR/$login.json"
7779
if [ -f "$CACHE_FILE" ]; then
7880
USER_JSON=$(<"$CACHE_FILE")
@@ -83,6 +85,13 @@ while :; do
8385
fi
8486

8587
SANITIZED_JSON=$(echo "$USER_JSON" | tr -d '\000-\037')
88+
89+
USER_TYPE=$(jq -r '.type // "User"' <<< "$SANITIZED_JSON")
90+
if [[ "$USER_TYPE" == "Bot" ]]; then
91+
continue
92+
fi
93+
94+
USERS+=("$login")
8695
NAME=$(jq -r '.name // empty' <<< "$SANITIZED_JSON")
8796
echo "$login|$NAME" >> "$TMP_USERS"
8897
fi

0 commit comments

Comments
 (0)