Skip to content

Commit

Permalink
CI: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Jul 7, 2024
1 parent 211b4b4 commit 10f875a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/updateInfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@ jobs:
run: |
python opml_generator.py
- name: Commit files
id: commit
run: |
echo "new=$(git status --porcelain)" >> $GITHUB_OUTPUT
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "update README and feed.opml after adding blog(s)" || echo "nothing to commit"
changes=$(git status --porcelain)
if [ -z "$changes" ]; then
echo "has_changes=false" >> $GITHUB_ENV
echo "nothing to commit"
else
echo "has_changes=true" >> $GITHUB_ENV
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "update README and feed.opml after adding blog(s)"
fi
- name: Push changes
if: steps.commit.new != ''
if: env.has_changes == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 10f875a

Please sign in to comment.