Skip to content

Commit

Permalink
ci: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
toFrankie committed Aug 3, 2024
1 parent 26bf002 commit 01be5e4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ jobs:
- name: Install dependencies
run: npm install

- name: Configure git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Pull latest changes
run: git pull origin main

Expand All @@ -33,10 +28,22 @@ jobs:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
run: node scripts/update-readme.js

- name: Check if README.md has changed
id: check_changes
run: |
if git diff --exit-code README.md; then
echo "file_changed=false" >> $GITHUB_ENV
else
echo "file_changed=true" >> $GITHUB_ENV
fi
- name: Commit changes
if: env.file_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m "docs: update readme"
git push origin main

0 comments on commit 01be5e4

Please sign in to comment.