From 0ec3f18b4416ce78701dcd3cbe3681f2db8752e6 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Wed, 22 Apr 2020 23:10:22 +1000 Subject: [PATCH] [CI] Introduce GitHub checks based linting with reviewdog (#900) * [CI] Introduce linting for branch commits with reviewdog This utilises the GitHub checks API and could be a potential candidate instead of in-line PR reviews. * [CI] Change reporter to `github-check` * [CI] Adjust linting in-line PR commentary to execute with linting step --- .buildkite/hooks/post-command | 4 ++-- .buildkite/pipeline.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.buildkite/hooks/post-command b/.buildkite/hooks/post-command index edcdb714..d19dc7ce 100755 --- a/.buildkite/hooks/post-command +++ b/.buildkite/hooks/post-command @@ -3,8 +3,8 @@ set +u if [[ $BUILDKITE_PULL_REQUEST != "false" ]]; then - if [[ $BUILDKITE_LABEL == ":hammer_and_wrench: Unit Test" ]]; then - echo "--- :go::service_dog: Linting pull request" + if [[ $BUILDKITE_LABEL == ":service_dog: Linting" ]]; then + echo "--- :go::service_dog: Provide in-line commentary for pull request" reviewdog -reporter=github-pr-review fi fi diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index 01a5c157..9aa1ac51 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -26,6 +26,10 @@ env: CI_BYPASS: ${CI_BYPASS} steps: + - label: ":service_dog: Linting" + command: "reviewdog -reporter=github-check" + if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true" + - label: ":hammer_and_wrench: Unit Test" command: "authelia-scripts --log-level debug ci" if: build.branch !~ /^(master)|(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ && build.env("CI_BYPASS") != "true"