From ce8e52f4d02016498d7bb66be061508c57063c05 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Thu, 4 Nov 2021 18:12:26 +0100 Subject: [PATCH] ci: fix job syntax --- .../{code-style-check.yaml => code_style_check.yaml} | 2 +- scripts/elvis-check.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) rename .github/workflows/{code-style-check.yaml => code_style_check.yaml} (98%) diff --git a/.github/workflows/code-style-check.yaml b/.github/workflows/code_style_check.yaml similarity index 98% rename from .github/workflows/code-style-check.yaml rename to .github/workflows/code_style_check.yaml index 581dc4316..f08060ec2 100644 --- a/.github/workflows/code-style-check.yaml +++ b/.github/workflows/code_style_check.yaml @@ -23,5 +23,5 @@ jobs: ./scripts/elvis-check.sh $GITHUB_BASE_REF emqx fi - name: Check line-break at EOF - - run: | + run: | ./scripts/check-nl-at-eof.sh diff --git a/scripts/elvis-check.sh b/scripts/elvis-check.sh index ebcea98bc..204ba3f7a 100755 --- a/scripts/elvis-check.sh +++ b/scripts/elvis-check.sh @@ -5,10 +5,11 @@ set -euo pipefail +set -x elvis_version='1.0.0-emqx-2' base="${1:-}" -repo="${2:-emqx}" +repo="${2:-emqx/emqx}" REPO="${GITHUB_REPOSITORY:-${repo}}" if [ "${base}" = "" ]; then echo "Usage $0 " @@ -27,7 +28,8 @@ if [[ "$base" =~ [0-9a-f]{8,40} ]]; then # base is a commit sha1 compare_base="$base" else - remote="$(git remote -v | grep -E "github\.com(:|/)emqx/$REPO((\.git)|(\s))" | grep fetch | awk '{print $1}')" + git remote -v + remote="$(git remote -v | grep -E "github\.com(:|/)$REPO((\.git)|(\s))" | grep fetch | awk '{print $1}')" git fetch "$remote" "$base" compare_base="$remote/$base" fi