-
-
Notifications
You must be signed in to change notification settings - Fork 19
99 lines (98 loc) · 9.31 KB
/
test.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: "Build + Test"
on:
pull_request:
push:
branches:
- main
- 'releases/*'
workflow_dispatch:
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm install
- run: |
npm run all
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Basic Content Test
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
content: test
- name: Test `@ping`
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
content: Hey there <@211894927997534208>
- name: Test with JSON Payload Provided
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
raw-data: __tests__/data/content-only.json
- name: Upload File
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
filename: __tests__/data/content-only.json
username: Bill
content: You should definitely be able to do this
avatar-url: https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256
- name: Discord Webhook Action With Embed
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
username: Bill
avatar-url: https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256
embed-title: "Foo"
embed-url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
embed-description: "Bar [test](https://google.com)"
embed-author-name: "Bill"
embed-author-icon-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-author-url: "https://google.com"
embed-thumbnail-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-image-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-footer-icon-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-footer-text: "Foot text [test](https://google.com)"
embed-color: 15430476
embed-timestamp: "2021-09-24T02:17:53+0000"
- name: Sleep for a second
run: sleep 1s
- name: Discord Webhook Action With Embed Description That's Too Long
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
username: Bill
avatar-url: https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256
embed-title: "Foo"
embed-url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
embed-description: "steaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteaksteak"
embed-author-name: "Bill"
embed-author-icon-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-author-url: "https://google.com"
embed-thumbnail-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-image-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-footer-icon-url: "https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256"
embed-footer-text: "Foot text [test](https://google.com)"
embed-color: 15430476
embed-timestamp: "2021-09-24T02:17:53+0000"
- name: Discord Webhook Action to Thread
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
username: Bill
content: Threaded message
avatar-url: https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256
thread-id: ${{ secrets.TEST_THREAD_ID }}
- name: Discord Webhook Action Confirm Message Sent
uses: ./
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
username: Bill
content: Discord will not confirm this was sent successfully before replying.
avatar-url: https://cdn.discordapp.com/avatars/742807869023322232/dd41912939ffccbea0276f70688fa0ec.webp?size=256
wait: false