Skip to content

Commit

Permalink
feat: annotate errors on CI
Browse files Browse the repository at this point in the history
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
  • Loading branch information
f0rmiga committed Jan 11, 2022
1 parent 4a7f484 commit ef5b390
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tidy_up_repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set -o errexit -o nounset -o pipefail

# First verify if the repository is clean.
if ! git diff --exit-code; then
>&2 echo "ERROR: The repository is not clean - please verify the changes and fix them."
error_msg="ERROR: The repository is not clean - please verify the changes and fix them."
echo "::error ::${error_msg}"
exit 1
fi

Expand All @@ -21,7 +22,8 @@ commands=(
for cmd in "${commands[@]}"; do
/bin/bash -c "${cmd}"
if ! git diff --exit-code; then
>&2 echo "ERROR: Please run '${cmd}' and commit the changes."
error_msg="ERROR: Please run '${cmd}' and commit the changes."
echo "::error ::${error_msg}"
exit 1
fi
done

0 comments on commit ef5b390

Please sign in to comment.