-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (69 loc) · 2.61 KB
/
congratsbot.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
75
name: Congratsbot
on:
workflow_call:
secrets:
DISCORD_WEBHOOK:
description: >
URL of a Discord webhook. To create one:
1. Find the channel you want to post congrats 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 congrats bot 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 <names> for helping! ✨",
"<names> stepped up to lend a hand — thank you! 🙌",
"<names> with the assist! 💪",
"Couldn’t have done this without <names>! 💜",
"Made even better by <names>! 🚀",
"And the team effort award goes to… <names>! 🏆",
"Featuring contributions by <names>! 🌟"
]
type: string
required: false
jobs:
post-message:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'withastro/automation'
ref: 'main'
path: 'automation'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- 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/.github/congratsbot.mjs
- name: Send message on Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: '${{ steps.message.outputs.DISCORD_MESSAGE }}'