Skip to content

Commit

Permalink
Update update_clone_badge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jvhagey authored Mar 20, 2024
1 parent 4fb4d7f commit aa78882
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/update_clone_badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
node-version: '20.x'

- name: Get clone count
id: get_clone_count
run: |
CLONE_COUNT=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/traffic/clones \
| jq '.clones | map(.count) | add')
echo "::set-output name=clone_count::$CLONE_COUNT"
# Fetch clone count from GitHub API
CLONE_COUNT=$(curl -s -H "Authorization: ***" \
https://api.github.com/repos/CDCgov/phoenix/traffic/clones \
| jq -r '.clones | if . == null then "0" else map(.count) | add | tostring else "0" end')
- name: Update README badge
run: |
Expand Down

0 comments on commit aa78882

Please sign in to comment.