From fedff9b9bdefa4a0f1e10bb59021324dd2423559 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 15 Jul 2022 11:43:33 +0700 Subject: [PATCH 1/2] add a github actions bot --- .github/workflows/hint.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 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 0000000..805905b --- /dev/null +++ b/.github/workflows/hint.yml @@ -0,0 +1,33 @@ +name: Hint to a github contributor + +on: + pull_request: + 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\" }" From 2d01cc396119ca2c9fa3445dd8baea0e2a04128f Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 15 Jul 2022 12:14:40 +0700 Subject: [PATCH 2/2] use pull_request_target --- .github/workflows/hint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hint.yml b/.github/workflows/hint.yml index 805905b..3cf356c 100644 --- a/.github/workflows/hint.yml +++ b/.github/workflows/hint.yml @@ -1,7 +1,7 @@ name: Hint to a github contributor on: - pull_request: + pull_request_target: types: [opened, created] jobs: