-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACTIONS: Add new workflow to count homebrew downloads
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Homebrew Repo Clone Count | ||
|
||
on: | ||
schedule: | ||
- cron: "0 */8 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Parse clone count using REST API | ||
run: | | ||
curl --user "${ github.actor }}:${{ secrets.SECRET_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 --global user.name "GitHub Action" | ||
git config --global user.email "[email protected]" | ||
git commit -m "BOT: Update count.json" | ||
- name: Push | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }}{ |