From 60656c1b56d312d95bda23d119b902d60819b20b Mon Sep 17 00:00:00 2001 From: Lucas PASCAL Date: Mon, 14 Mar 2022 10:20:48 +0100 Subject: [PATCH] [fix] Bad bash syntax in github action --- .github/actions/commit-changes/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/actions/commit-changes/action.yml b/.github/actions/commit-changes/action.yml index 0d8ac4f..a1515bd 100644 --- a/.github/actions/commit-changes/action.yml +++ b/.github/actions/commit-changes/action.yml @@ -38,6 +38,7 @@ runs: using: 'composite' steps: - name: Commit the changes + id: commit run: | git config --global user.name ${{ inputs.name }} ORIGIN="$(pwd)" @@ -48,17 +49,20 @@ runs: if [ -z "${CHANGES}" ]; \ then \ echo "No changes, stopping now"; \ - cd ${origin} \ + echo "::save-state name=COMMIT::NO"; \ + cd "${ORIGIN}"; \ exit 0; \ fi echo -e "Changes:\n${CHANGES}" git add ${{ inputs.files }} git commit -am "${{ inputs.message }}" + echo "::save-state name=COMMIT::YES" git log -n 2 - cd ${ORIGIN} + cd "${ORIGIN}" shell: bash - name: Push commit + if: ${{ steps.commit.state.COMMIT == 'YES' }} uses: ad-m/github-push-action@master with: github_token: ${{ inputs.secret }}