Skip to content

Commit

Permalink
get total downloads across brew & github
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhupesh-V authored Aug 11, 2022
1 parent 71d5b18 commit 24e015e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/download-stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Get ugit Download Stats
on:
workflow_dispatch:
schedule:
# everyday 9:30 pm
- cron: '0 16 * * *'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Get Download Count
id: download-stats
run: |
echo ::set-output name=download_count::$((curl -sq https://formulae.brew.sh/api/formula/ugit.json | jq '.analytics.install_on_request."365d".ugit' | tr "\012" "+" && (curl -sq https://api.github.com/repos/Bhupesh-V/ugit/releases | jq .[].assets[0].download_count | tr "\012" "+" ; echo "0")) | bc)
- name: Create Awesome Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: 6b7b8e8576bc1ca237bffd9a344672ab
filename: ugit-downloads.json
label: ${{ steps.downloads-stats.outputs.download_count }}
message: downloads
color: "#820F82"

0 comments on commit 24e015e

Please sign in to comment.