From e690fa821d1565296bcb7fe79810cb4b73088e97 Mon Sep 17 00:00:00 2001 From: Grigorii Date: Fri, 20 Jan 2023 15:09:49 +0300 Subject: [PATCH] Add GitHub actions (#22) * Add tg-notify on closed PRs * Add pep8speaks settings * fixup! Add tg-notify on closed PRs --- .github/workflows/notify.yml | 35 +++++++++++++++++++++++++++++++++++ .pep8speaks.yml | 9 +++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/notify.yml create mode 100644 .pep8speaks.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 00000000..b8494f1e --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,35 @@ +name: telegram notify +on: + pull_request: + types: [ closed ] + +jobs: + + merge_job: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: send custom message with args + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_TOKEN }} + args: "The ${{github.event_name}} '${{github.event.pull_request.title}}' (#${{github.event.number}}) was merged. + \nLink: ${{github.event.pull_request.html_url}} + \nDescription: ${{github.event.pull_request.body}} + \n + \nCheck it out to keep your local repository updated." + + + close_job: + if: github.event.pull_request.merged == false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: send custom message with args + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.CHAT_ID }} + token: ${{ secrets.TELEGRAM_TOKEN }} + args: The ${{github.event_name}} ${{github.event.pull_request.title}} (${{github.event.number}}) was closed. diff --git a/.pep8speaks.yml b/.pep8speaks.yml new file mode 100644 index 00000000..03fa3391 --- /dev/null +++ b/.pep8speaks.yml @@ -0,0 +1,9 @@ +scanner: + diff_only: False # The entire file touched by the PR will be scanned for errors + linter: flake8 + +flake8: + max-line-length: 120 # Default is 79 in PEP 8 + ignore: [] + +no_blank_comment: False # Every PR will have its own pep8speaks stats