Clones #766
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) | |
# Controls when the action will run. | |
on: | |
schedule: | |
- cron: "0 5 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- 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: Get Date | |
# run: echo "DATE=$(date +%Y/%m/%d-%H:%M:%S)" >> $GITHUB_ENV | |
#- name: Create Pull Request | |
# id: cpr | |
# uses: peter-evans/create-pull-request@v3 | |
# with: | |
# token: ${{ secrets.SECRET_TOKEN }} | |
# commit-message: Update report | |
# committer: GitHub <[email protected]> | |
# author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
# branch: clones-badge-update | |
# delete-branch: true | |
# title: 'Clones badge update' | |
# body: | | |
# Update .github/clone.json file | |
# - Updated on ${{ env.DATE }} | |
# - Auto-pull-requested by https://github.com/peter-evans/create-pull-request | |
# assignees: ${{ github.actor }} | |
# reviewers: ${{ github.actor }} | |
# team-reviewers: | | |
# owners | |
# maintainers | |
# draft: false | |
- name: Push | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |