Skip to content

Commit b18129f

Browse files
committed
Improve activity rendering
Previously branch creations and deletions would be a comparison between the invalid zero commit and the create/deleted commit
1 parent edd860c commit b18129f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/retire.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,20 @@ fi
5252
mkdir -p "$DIR"
5353
cd "$DIR"
5454
for login in *; do
55-
trace gh api -X GET /repos/"$ORG"/"$ACTIVITY_REPO"/activity -f time_period=year -f actor="$login" -f per_page=100 \
56-
--jq ".[] | \"- \(.timestamp) [\(.activity_type) on \(.ref | ltrimstr(\"refs/heads/\"))](https://github.com/$ORG/$ACTIVITY_REPO/compare/\(.before)...\(.after))\"" \
55+
trace gh api -X GET /repos/"$ORG"/"$ACTIVITY_REPO"/activity \
56+
-f time_period=year \
57+
-f actor="$login" \
58+
-f per_page=100 \
59+
--jq '.[] |
60+
"- \(.timestamp) [\(.activity_type) on \(.ref | ltrimstr("refs/heads/"))](https://github.com/'"$ORG/$ACTIVITY_REPO"'/\(
61+
if .activity_type == "branch_creation" then
62+
"commit/\(.after)"
63+
elif .activity_type == "branch_deletion" then
64+
"commit/\(.before)"
65+
else
66+
"compare/\(.before)...\(.after)"
67+
end
68+
))"' \
5769
> "$tmp/$login"
5870
activityCount=$(wc -l <"$tmp/$login")
5971

0 commit comments

Comments
 (0)