mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
dist/tools/pr_check: annotate errors in Github Action
This commit is contained in:
parent
375df5740a
commit
d4628dc07f
23
dist/tools/pr_check/check.sh
vendored
23
dist/tools/pr_check/check.sh
vendored
@ -7,6 +7,8 @@
|
||||
# directory for more details.
|
||||
#
|
||||
|
||||
. "$(dirname "$0")/../ci/github_annotate.sh"
|
||||
|
||||
: "${RIOTBASE:=$(cd $(dirname $0)/../../../; pwd)}"
|
||||
cd $RIOTBASE
|
||||
|
||||
@ -14,6 +16,8 @@ cd $RIOTBASE
|
||||
|
||||
EXIT_CODE=0
|
||||
|
||||
github_annotate_setup
|
||||
|
||||
if tput colors &> /dev/null && [ $(tput colors) -ge 8 ]; then
|
||||
CERROR="\e[1;31m"
|
||||
CRESET="\e[0m"
|
||||
@ -39,9 +43,24 @@ SQUASH_COMMITS="$(git log $(git merge-base HEAD "${RIOT_MASTER}")...HEAD --prett
|
||||
keyword_filter)"
|
||||
|
||||
if [ -n "${SQUASH_COMMITS}" ]; then
|
||||
echo -e "${CERROR}Pull request needs squashing:${CRESET}" 1>&2
|
||||
echo -e "${SQUASH_COMMITS}"
|
||||
if github_annotate_is_on; then
|
||||
echo "${SQUASH_COMMITS}" | while read commit; do
|
||||
ANNOTATION="Commit needs to be squashed: \"${commit}\""
|
||||
ANNOTATION="${ANNOTATION}\n\nPLEASE ONLY SQUASH WHEN ASKED BY A "
|
||||
ANNOTATION="${ANNOTATION}MAINTAINER!"
|
||||
ANNOTATION="${ANNOTATION}\nSee: "
|
||||
ANNOTATION="${ANNOTATION}https://github.com/RIOT-OS/RIOT/blob/master/CONTRIBUTING.md#squash-commits-after-review"
|
||||
github_annotate_error_no_file "${ANNOTATION}"
|
||||
done
|
||||
else
|
||||
echo -e "${CERROR}Pull request needs squashing:${CRESET}" 1>&2
|
||||
echo -e "${SQUASH_COMMITS}"
|
||||
fi
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
|
||||
github_annotate_teardown
|
||||
|
||||
github_annotate_report_last_run
|
||||
|
||||
exit ${EXIT_CODE}
|
||||
|
Loading…
Reference in New Issue
Block a user