From 5f757d75aa9afd1b40228bf3fe7ca92af9f48ce2 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 15 Jul 2022 11:27:10 +0700 Subject: [PATCH] add github actions bot with a hint comment for contributors. Signed-off-by: Igor Zhukov --- .github/workflows/hint.yml | 33 +++++++++++++++++++++++++++++++++ Makefile.am | 1 + 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/hint.yml diff --git a/.github/workflows/hint.yml b/.github/workflows/hint.yml new file mode 100644 index 0000000000..3cf356cb16 --- /dev/null +++ b/.github/workflows/hint.yml @@ -0,0 +1,33 @@ +name: Hint to a github contributor + +on: + pull_request_target: + types: [opened, created] + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Add comment to PR + env: + URL: ${{ github.event.pull_request.comments_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MESSAGE: + Hi!\n + Thanks for the patch.\n + Please take a look at + https://github.com/ovn-org/ovn/blob/main/Documentation/internals/contributing/submitting-patches.rst + and + https://github.com/ovn-org/ovn/blob/main/Documentation/internals/contributing/coding-style.rst\n + Squash commits and ensure that your patch passes the checks:\n + ```\n + $ ./utilities/checkpatch.py -1\n + ```\n + + run: | + curl \ + -X POST \ + $URL \ + -H "Content-Type: application/json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + --data "{ \"body\": \"$MESSAGE\" }" diff --git a/Makefile.am b/Makefile.am index 3b0df83938..1f039d0fe5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -91,6 +91,7 @@ EXTRA_DIST = \ .ci/osx-build.sh \ .ci/osx-prepare.sh \ .ci/ovn-kubernetes/Dockerfile \ + .github/workflows/hint.yml \ .github/workflows/test.yml \ .github/workflows/ovn-kubernetes.yml \ boot.sh \