Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always set num_changed output #65

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,20 @@ else
done
fi

# always set num_changed output
set +e
num_changed=$(git_status)
set -e
echo "::set-output name=num_changed::${num_changed}"

if [ "${INPUT_GIT_PUSH}" = "true" ]; then
git_commit
git push
else
set +e
num_changed=$(git_status)
set -e
if [ "${INPUT_FAIL_ON_DIFF}" = "true" ] && [ "${num_changed}" -ne 0 ]; then
echo "::error file=entrypoint.sh,line=169::Uncommitted change(s) has been found!"
exit 1
fi
echo "::set-output name=num_changed::${num_changed}"
fi

exit 0