Track Release Downloads #108
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |