Skip to content

refactor: Flex o'clock! ⏰ #772

refactor: Flex o'clock! ⏰

refactor: Flex o'clock! ⏰ #772

Workflow file for this run

name: Update Badge
on:
push:
branches:
- main
paths:
- 'gym/lifts.txt'
jobs:
update-badge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Read value from file
id: read-value
run: |
VALUE=$(cat gym/lifts.txt)
echo "value=$VALUE" >> $GITHUB_ENV
- name: Update README.md with the new badge value
run: |
VALUE=${{ env.value }}
sed -i "s/Git_Lifts_πŸ’ͺ-[^)]*/Git_Lifts_πŸ’ͺ-${VALUE}-blue/" README.md
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m "docs(ci): update git lift badge value πŸ…"
- name: Pull latest changes
run: |
git pull origin main --rebase
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
git push