Update examples to use version 6.0.0 #226
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |