From a816776cb5cd641b152d39ac69f50bf21b86b04d Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 6 Oct 2021 20:34:38 +0200 Subject: [PATCH] Add matrix bot --- .github/workflows/matrix-bot.yml | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/matrix-bot.yml diff --git a/.github/workflows/matrix-bot.yml b/.github/workflows/matrix-bot.yml new file mode 100644 index 00000000..3e2a865b --- /dev/null +++ b/.github/workflows/matrix-bot.yml @@ -0,0 +1,44 @@ +name: Matrix bot +on: + pull_request_target: + types: [opened, closed] + +jobs: + new-pr: + if: github.event.action == 'opened' && github.repository == 'embassy-rs/embassy' + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: send message + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "New PR: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})" + server: "matrix.org" + + merged-pr: + if: github.event.action == 'closed' && github.event.pull_request.merged == true && github.repository == 'embassy-rs/embassy' + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: send message + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "PR merged: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})" + server: "matrix.org" + + abandoned-pr: + if: github.event.action == 'closed' && github.event.pull_request.merged == false && github.repository == 'embassy-rs/embassy' + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: send message + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.MATRIX_ROOM_ID }} + access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} + message: "PR closed without merging: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})" + server: "matrix.org"