-
Notifications
You must be signed in to change notification settings - Fork 24
34 lines (32 loc) · 1.45 KB
/
notify-slack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: 📢 Notify Slack of changed PR
on:
pull_request:
types: [closed]
jobs:
notify:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-pull_request-workflow-when-a-pull-request-merges
if: >
github.event.pull_request.merged == true
&& !contains(github.event.pull_request.labels.*.name, 'dependencies')
runs-on: ubuntu-latest
steps:
- name: "📢 Notify the #mep-c1 channel"
# Can't use `!contains(...)` because it give us a "tag suffix cannot contain flow indicator characters" error.
# Oddly enough, using `if: > !contains(...)` works...
if: contains(github.event.pull_request.labels.*.name, 'no-changelog') == false
uses: slackapi/slack-github-action@v2.0.0
with:
webhook: ${{ secrets.SLACK_MEP_C1_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: >-
${{ format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) }}
- name: "📢 Notify the #mep-c2 channel"
if: contains(github.event.pull_request.labels.*.name, 'pilotage')
uses: slackapi/slack-github-action@v2.0.0
with:
webhook: ${{ secrets.SLACK_MEP_C2_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: >-
${{ format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) }}