From b06e2f99fa8a053705af0150080525528fe5f848 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Thu, 9 Dec 2021 08:46:16 +0530 Subject: chore: refactor to skip steps if no commits needed [skip ci] --- .github/workflows/dependency-updates.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to '.github/workflows/dependency-updates.yml') diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 514a5ebb3..5dde7c662 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -46,18 +46,23 @@ jobs: rm -rf ./recipes npm run update-submodules git add . + echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV - name: Update browserslist db run: | npx browserslist@latest --update-db git add . + echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV - name: Run linter, reformatter, rebrander and tests + if: ${{ env.GIT_DIRTY != '0' }} run: | npm run prepare-code npm run test - name: Commit submodules, dependency-updates and linter changes + if: ${{ env.GIT_DIRTY != '0' }} run: | git config user.name github-actions git config user.email github-actions@github.com - [[ -n $(git status -s) ]] && git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify + git commit -am "Update submodules, browserslist data updates and linter fixes [skip ci]" --no-verify || true - name: Push all changes + if: ${{ env.GIT_DIRTY != '0' }} run: git push origin ${{ env.GIT_BRANCH_NAME }} --no-verify -- cgit v1.2.3-70-g09d2