From 0fc8c550e19f543f61b57e6431c58c3cbebb4780 Mon Sep 17 00:00:00 2001 From: Andrew Luca Date: Mon, 20 Jan 2020 21:22:44 +0200 Subject: [PATCH] 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 --- .github/workflows/populate-readme.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/populate-readme.yml b/.github/workflows/populate-readme.yml index 8660b8ba..f9885179 100644 --- a/.github/workflows/populate-readme.yml +++ b/.github/workflows/populate-readme.yml @@ -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