Clones #787
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: Clones | |
# Count (for 14 days every days at 05:00 UTC) | |
on: | |
schedule: | |
- cron: "0 5 * * *" | |
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/${{ github.repository }}/traffic/clones \ | |
> .github/clone.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 "Automated clone.json update" | |
- name: Push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |