Skip to content

Fix/mathquill

Fix/mathquill #6

name: PR Notifications
on:
pull_request:
types: [opened, closed, reopened]
pull_request_review:
types: [submitted]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Notify Slack on PR Opened
if: github.event.action == 'opened'
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": "πŸ”” New PR in pie-elements-ng",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "πŸ”” New Pull Request"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n${{ github.repository }}"
},
{
"type": "mrkdwn",
"text": "*PR:*\n<${{ github.event.pull_request.html_url }}|#${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}>"
},
{
"type": "mrkdwn",
"text": "*Author:*\n${{ github.event.pull_request.user.login }}"
},
{
"type": "mrkdwn",
"text": "*Base:*\n${{ github.event.pull_request.base.ref }}"
},
{
"type": "mrkdwn",
"text": "*Head:*\n${{ github.event.pull_request.head.ref }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Notify Slack on PR Merged
if: github.event.action == 'closed' && github.event.pull_request.merged == true
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": "βœ… PR Merged in pie-elements-ng",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "βœ… Pull Request Merged"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n${{ github.repository }}"
},
{
"type": "mrkdwn",
"text": "*PR:*\n<${{ github.event.pull_request.html_url }}|#${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}>"
},
{
"type": "mrkdwn",
"text": "*Author:*\n${{ github.event.pull_request.user.login }}"
},
{
"type": "mrkdwn",
"text": "*Merged by:*\n${{ github.event.pull_request.merged_by.login }}"
},
{
"type": "mrkdwn",
"text": "*Into:*\n${{ github.event.pull_request.base.ref }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Notify Slack on PR Closed (not merged)
if: github.event.action == 'closed' && github.event.pull_request.merged == false
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": "❌ PR Closed in pie-elements-ng",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "❌ Pull Request Closed"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n${{ github.repository }}"
},
{
"type": "mrkdwn",
"text": "*PR:*\n<${{ github.event.pull_request.html_url }}|#${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}>"
},
{
"type": "mrkdwn",
"text": "*Author:*\n${{ github.event.pull_request.user.login }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Notify Slack on PR Review
if: github.event_name == 'pull_request_review'
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
"text": "πŸ‘€ PR Review in pie-elements-ng",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ github.event.review.state == 'approved' && 'βœ… PR Approved' || github.event.review.state == 'changes_requested' && 'πŸ”„ Changes Requested' || 'πŸ’¬ PR Reviewed' }}"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n${{ github.repository }}"
},
{
"type": "mrkdwn",
"text": "*PR:*\n<${{ github.event.pull_request.html_url }}|#${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}>"
},
{
"type": "mrkdwn",
"text": "*Reviewer:*\n${{ github.event.review.user.login }}"
},
{
"type": "mrkdwn",
"text": "*State:*\n${{ github.event.review.state }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PR_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK