Get ugit Download Stats #869
This file contains 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: 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: downloads | |
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/dynamic-badges-action@v1.1.0 | |
with: | |
auth: ${{ secrets.GIST_TOKEN }} | |
gistID: 6b7b8e8576bc1ca237bffd9a344672ab | |
filename: ugit-downloads.json | |
label: downloads | |
message: ${{ steps.downloads.outputs.download_count }} | |
color: "#820F82" |