From 94f3d0dc11f8c4fead6b304bd4f754666e981f55 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 26 Apr 2021 16:20:35 +0900 Subject: [PATCH] infra Actions: If no coding style error, no comment and change action name --- .github/workflows/actions.yml | 2 +- .github/workflows/actions_cpplint.yml | 4 ++-- .github/workflows/cpp_lint_check.sh | 9 ++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c69c4866..5862d321 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,4 +1,4 @@ -name: Continuous-integration +name: Build Test on: pull_request: diff --git a/.github/workflows/actions_cpplint.yml b/.github/workflows/actions_cpplint.yml index da706169..fe429355 100644 --- a/.github/workflows/actions_cpplint.yml +++ b/.github/workflows/actions_cpplint.yml @@ -1,4 +1,4 @@ -name: PullRequest_Checker +name: Check Commit on: pull_request: @@ -6,7 +6,7 @@ on: - master jobs: - build: + coding-style: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/cpp_lint_check.sh b/.github/workflows/cpp_lint_check.sh index c130da3f..405f9e02 100644 --- a/.github/workflows/cpp_lint_check.sh +++ b/.github/workflows/cpp_lint_check.sh @@ -37,7 +37,7 @@ cpplint --filter=-,\ PAYLOAD_CPPLINT=`cat cpp-report.txt` COMMENTS_URL=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.comments_url) - + echo $COMMENTS_URL echo "Cppcheck errors:" echo $PAYLOAD_CPPLINT @@ -47,13 +47,8 @@ if [[ $PAYLOAD_CPPLINT == *"Total errors found: "* ]]; then OUTPUT+=$'\n```\n' OUTPUT+="$PAYLOAD_CPPLINT" OUTPUT+=$'\n```\n' - -else - OUTPUT+=$'\n**CODING STYLE CHECK**:\n' - OUTPUT+=$'\n```\n' - OUTPUT+="Perfect." - OUTPUT+=$'\n```\n' fi + PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body') curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"