[go: nahoru, domu]

Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfoxie committed Dec 16, 2021
1 parent ee572fa commit 83b28f6
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
name: GitHub Clone Count
# based on: https://github.com/andry81/github-accum-stats
#

name: "github-accum-stats: GitHub clones counter for 14 days at every 8 hours and clones accumulator"

# Controls when the action will run.
on:
schedule:
- cron: "0 */8 * * *"
# 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
accum-gh-clone-stats:
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
- uses: mrfoxie/gh-action--accum-gh-stats@master
with:
deps_repo_owner: mrfoxie

- 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 \
> clone.json
stat_repo_owner: mrfoxie
stat_repo: github-accum-stats
stat_entity_path: traffic/clones
stat_repo_read_token: ${{ secrets.GITHUB_TOKEN }}
stats_list_key: clones

- name: Add to git repo
run: |
git add .
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
git commit -m "Automated clone.json update"
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
curl_flags: >-
-H 'Cache-Control: no-cache'
output_repo_owner: andry81
output_repo: github-accum-stats--gh-stats
output_repo_branch: master
output_repo_dir: traffic/clones
# NOTE: You should use something like `secrets.WRITE_STATS_TOKEN` if the input and the output repository has different owners.
output_repo_write_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 83b28f6

Please sign in to comment.