diff --git a/.github/workflows/comment.yml b/.github/workflows/comment.yml new file mode 100644 index 000000000..f70ba2a9f --- /dev/null +++ b/.github/workflows/comment.yml @@ -0,0 +1,23 @@ +name: Comment +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + +jobs: + build: + name: Telegram + runs-on: ubuntu-latest + if: ${{ github.event.issue.pull_request }} + steps: + - name: Send telegram message on push + uses: appleboy/telegram-action@v1.0.0 + with: + to: ${{ secrets.TELEGRAM_ISSUE_CHAT_ID }} + token: ${{ secrets.TELEGRAM_ISSUE_TOKEN }} + format: Markdown + # this might go wrong, because `title` and `body` can have arbitrary markdown + message: | + ✏️ [${{ github.event.comment.user.login }}](${{ github.event.comment.html_url }}): ${{ github.event.comment.body }} + 🔀 ${{ github.event.issue.title }} diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml new file mode 100644 index 000000000..9fc6612a2 --- /dev/null +++ b/.github/workflows/pull.yml @@ -0,0 +1,22 @@ +name: Pull request +on: + pull_request: + types: [opened, reopened] + +jobs: + build: + name: Telegram + runs-on: ubuntu-latest + steps: + - name: Send telegram message on push + uses: appleboy/telegram-action@v1.0.0 + with: + to: ${{ secrets.TELEGRAM_ISSUE_CHAT_ID }} + token: ${{ secrets.TELEGRAM_ISSUE_TOKEN }} + format: Markdown + # this might go wrong, because `title` can have arbitrary markdown + message: | + 🍰 [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }}) + 🌲 ${{ github.repository }} + 👤 ${{ github.actor }} + 🔀 ${{ github.event.pull_request.base.label }} <- ${{ github.event.pull_request.head.label }}