Skip to content

Track Release Downloads #108

Track Release Downloads

Track Release Downloads #108

name: "Track Release Downloads"
on:
schedule:
- cron: '0 */4 * * *' # Runs every four hours
workflow_dispatch: # Allows you to run it manually
jobs:
count-downloads:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Fetch and Count Downloads
run: |
# We use jq to navigate the JSON structure directly
TOTAL_DOWNLOADS=$(curl -s https://api.github.com/repos/vmware/powershell-module-for-vcf-patch-scanner/releases \
| jq '[.[] | .assets[].download_count] | add')
echo "Total Release Downloads: $TOTAL_DOWNLOADS"
# Optional: Save to a summary for the Action run
echo "### Release Statistics 📊" >> $GITHUB_STEP_SUMMARY
echo "- **Total Downloads:** $TOTAL_DOWNLOADS" >> $GITHUB_STEP_SUMMARY