update(actions): use heatmap.json for authoritative commit history
This commit is contained in:
@@ -26,10 +26,9 @@ jobs:
|
|||||||
elif command -v apt-get &> /dev/null; then apt-get update && apt-get install -y jq; fi
|
elif command -v apt-get &> /dev/null; then apt-get update && apt-get install -y jq; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
USER_URL="http://gitea-http:3000/api/v1/users/patrick/heatmap?limit=1000"
|
# Use our own heatmap.json instead of Gitea API
|
||||||
|
HEATMAP_FILE="public/heatmap.json"
|
||||||
RAW_DATA=$(wget -qO- --header="Authorization: token ${{ secrets.PAT_TOKEN }}" "$USER_URL")
|
TOTAL_COMMITS=$(jq '[.[] | .count] | add' "$HEATMAP_FILE")
|
||||||
TOTAL_COMMITS=$(echo "$RAW_DATA" | jq '. | map(.contributions) | add')
|
|
||||||
|
|
||||||
echo "Global Commit Velocity: $TOTAL_COMMITS"
|
echo "Global Commit Velocity: $TOTAL_COMMITS"
|
||||||
echo "COMMIT_VELOCITY=$TOTAL_COMMITS" >> $GITHUB_ENV
|
echo "COMMIT_VELOCITY=$TOTAL_COMMITS" >> $GITHUB_ENV
|
||||||
|
|||||||
Reference in New Issue
Block a user