Skip to content

Commit

Permalink
feat: recalculate open pr using the same algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
paolomainardi committed Jul 19, 2024
1 parent 15cbbbc commit d1220c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions evaluate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ while IFS= read -r project; do
# Get repository data
REPO_DATA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$OWNER/$REPO)
STARS=$(echo $REPO_DATA | jq .stargazers_count)
COMMITS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" --head https://api.github.com/repos/$OWNER/$REPO/commits\?sha\=main\&per_page\=1\&page\=1 | grep -i "Link:" | grep -o '<[^>]*>; rel="last"' | sed 's/.*<\(.*\)>.*/\1/' | sed 's/.*page=\([0-9]*\).*/\1/')
OPEN_PRS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$OWNER/$REPO/pulls?state=open | jq length)
DEFAULT_BRANCH=$(echo $REPO_DATA | jq .default_branch)
COMMITS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" --head https://api.github.com/repos/$OWNER/$REPO/commits\?sha\=${DEFAULT_BRANCH}\&per_page\=1\&page\=1 | grep -i "Link:" | grep -o '<[^>]*>; rel="last"' | sed 's/.*<\(.*\)>.*/\1/' | sed 's/.*page=\([0-9]*\).*/\1/')
OPEN_PRS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" --head https://api.github.com/repos/$OWNER/$REPO/pulls?state=open\&per_page\=1\&page\=1 | grep -i "Link:" | grep -o '<[^>]*>; rel="last"' | sed 's/.*<\(.*\)>.*/\1/' | sed 's/.*page=\([0-9]*\).*/\1/')
OPEN_ISSUES=$(echo $REPO_DATA | jq .open_issues)


# New API call to fetch license information
LICENSE_DATA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$OWNER/$REPO/license")

Expand All @@ -56,7 +56,7 @@ while IFS= read -r project; do
SCORECARD_SCORE=$(scorecard --repo=https://github.com/$OWNER/$REPO --format=json --checks $SCORECARD_CHECKS | jq '.score')

# Append each line of output to results.txt
echo -e "$project\t$STARS\t$COMMITS\t\t$OPEN_PRS\t$OPEN_ISSUES\t$SCORECARD_SCORE\t$LICENSE" >> results.txt
echo -e "$project\t$STARS\t$COMMITS\t$OPEN_PRS\t$OPEN_ISSUES\t$SCORECARD_SCORE\t$LICENSE" >> results.txt
done < "$PROJECTS_FILE"

column -t -s $'\t' results.txt
column -t -s $'\t' results.txt
2 changes: 1 addition & 1 deletion projects
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ollama/ollama
mudler/LocalAI
mudler/localai
janhq/jan
run-llama/llama_index
langchain-ai/langchain
Expand Down

0 comments on commit d1220c9

Please sign in to comment.