-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathissues.sh
31 lines (23 loc) · 1.05 KB
/
issues.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
OWNER="Sopra-Banking-Software-Interns"
REPO="Github-Leaderboard"
CONTRIBUTOR="Riyu44"
# Make a request to fetch the contributor's information
response=$(curl -s -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $token" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$OWNER/$REPO/issues?state=closed")
echo $response | jq -r '[.[] | select( .user.login=="Tushar-2510") | .url] | length'
# | jq '.[] | select( .state == "open" ) '
# # Parse the response to find the contributor's information
# contributor_info=$(echo "$response" | jq ".[] | select(.login == \"$CONTRIBUTOR\")")
# # Check if the contributor exists in the repository
# if [[ -z "$contributor_info" ]]; then
# echo "Contributor not found in the repository."
# exit 1
# fi
# # Get the number of issues solved by the contributor
# issues_solved=$(echo "$contributor_info" | jq ".contributions")
# # Print the number of issues solved by the contributor
# echo "Number of issues solved by $CONTRIBUTOR: $issues_solved"