-
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (68 loc) · 2.61 KB
/
mergebot.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: withStudioCMS Mergebot
on:
workflow_call:
secrets:
DISCORD_WEBHOOK:
description: >
URL of a Discord webhook. To create one:
1. Find the channel you want to post a message in.
2. Right-click and select “Edit Channel”.
3. Navigate to “Integrations” > “View Webhooks”.
4. Click “New Webhook” and copy the URL for your newly created webhook.
required: true
inputs:
EMOJIS:
description: >
Comma-delimited set of emojis.
Each mergebot message will pick one at random for the start of the message.
default: 🎉,🥳,💣,💥,🫡,🙌,👏,🙏,🏆
type: string
required: false
COAUTHOR_TEMPLATES:
description: >
A JSON array of co-author recognition templates.
Each template should contain the `<names>` placeholder.
This will be replaced by the names of one or more co-authors for this commit.
(Ignored for commits without any co-authors.)
When designing templates, bear in mind that `<names>` could be one, two, or more names.
default: >
[
"Thanks for the assist, <names>! 🙏",
"<names> coming in clutch—thank you! 🙌",
"<names> made it happen! 💪",
"We couldn't have done it without <names>! 👏",
"With essential contributions from <names>! 💣",
"Teamwork makes the dream work… right <names>?! 🏆",
"feat. <names>! 🫡"
]
type: string
required: false
jobs:
post-message:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: "withstudiocms/automations"
ref: "main"
path: "automation"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- id: message
name: Format Discord message
env:
GITHUB_REPO: ${{ github.event.repository.full_name }}
COMMIT_AUTHOR: ${{ github.event.commits[0].author.name }}
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
COMMIT_ID: ${{ github.event.commits[0].id }}
EMOJIS: ${{ inputs.EMOJIS }}
COAUTHOR_TEMPLATES: ${{ inputs.COAUTHOR_TEMPLATES }}
run: node automation/scripts/mergebot.js
- name: Send message on Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_MESSAGE: "${{ steps.message.outputs.DISCORD_MESSAGE }}"
run: node automation/scripts/discord.js