Skip to content

Homebrew Repo Clone Count #1489

Homebrew Repo Clone Count

Homebrew Repo Clone Count #1489

name: Homebrew Repo Clone Count
on:
schedule:
- cron: "0 */8 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Parse clone count using REST API
run: |
curl --user "Cian911:${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/Cian911/homebrew-switchboard/traffic/clones \
> count.json
- name: Add to git repo
run: |
git add .
git config --local user.name "GitHub Action"
git config --local user.email "[email protected]"
git commit -m "BOT: Update count.json" -a
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master