Skip to content

Commit

Permalink
Update update_clone_badge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HAISeq authored Mar 25, 2024
1 parent c183b44 commit ddc1596
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/update_clone_badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@ jobs:
echo "PREVIOUS_COUNT=$PREVIOUS_COUNT" >> $GITHUB_ENV
- name: Calculate new total clone count
if: ${{ env.PREVIOUS_COUNT != env.NEW_TOTAL }}
id: calculate_new_total
run: |
# Calculate new total clone count by adding today's count to previous count
NEW_TOTAL=$((PREVIOUS_COUNT + CLONE_COUNT))
echo "NEW_TOTAL=$NEW_TOTAL" >> $GITHUB_ENV
- name: Update README badge
if: ${{ env.PREVIOUS_COUNT != env.NEW_TOTAL }}
run: |
sed -i -E "s/Clones%3A%20[0-9]+/Clones%3A%20${{ env.NEW_TOTAL }}/g" README.md
- name: Commit and push changes
if: ${{ env.PREVIOUS_COUNT != env.NEW_TOTAL }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "HAISeq"
Expand Down

0 comments on commit ddc1596

Please sign in to comment.