chore: commit populate-readme only when chagnes

Sometimes action is started because some data.js only some style changes
And on generate working tree is empty
And action fails because nothing to commit
This commit is contained in:
Andrew Luca 2020-01-20 21:22:44 +02:00
parent b7a0f054f7
commit 0fc8c550e1
No known key found for this signature in database
GPG key ID: 8CEE7E0149460DB9

View file

@ -40,7 +40,10 @@ jobs:
git add readme.md
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# commit only if any changes
if [ ! -z "$(git status --porcelain)" ]; then
git commit -m "chore: generate \`readme.md\`, lint \`src/data.js\`"
fi
- name: Push changes
uses: ad-m/github-push-action@master