Skip to content

Commit

Permalink
Merge pull request #167 from tsickert/tsickert/update-node-20
Browse files Browse the repository at this point in the history
Update node 20
  • Loading branch information
tsickert authored Apr 5, 2024
2 parents 298ff1f + 54e44f8 commit ba39ddf
Show file tree
Hide file tree
Showing 18 changed files with 19,141 additions and 7,728 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist/
lib/
node_modules/
jest.config.js
jest.config.cjs
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"sort-imports": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
Expand Down Expand Up @@ -52,4 +53,4 @@
"es6": true,
"jest/globals": true
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/filtered_github_webhooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Discord Webhook Action
uses: tsickert/[email protected]
uses: ./
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
username: GitHub
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/os-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
webhook-url: ${{ secrets.WEBHOOK_URL }}
filename: __tests__/data/content-only.json
username: OS Tester (${{ matrix.os }})
content: You should definintely be able to do this
content: You should definitely be able to do this
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
webhook-url: ${{ secrets.WEBHOOK_URL }}
filename: __tests__/data/content-only.json
username: Bill
content: You should definintely be able to do this
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: ./
Expand Down Expand Up @@ -89,3 +89,11 @@ jobs:
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*
build

# JetBrains
.idea
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Want to know more about Discord Webhooks? Check out the [intro](https://support.
| thread-id | `false` | ID of the thread you want the webhook to send the message into (will automatically unarchive threads) |
| thread-name | `false` | Name of the thread you want the webhook to create |
| flags | `false` | Message flags |
| wait | `false` | Whether Discord should confirm the message was successfully sent before responding to the request (boolean) |
| username | `false` | The username that should appear to send the message. Note: username will have the "bot" badge next to their name |
| avatar-url | `false` | URL for the avatar that should appear with the message |
| tts | `false` | Whether the message is text-to-speech |
Expand Down
3 changes: 1 addition & 2 deletions __tests__/webhook.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {executeWebhook} from '../src/webhook'
import {expect, test} from '@jest/globals'

test('fails with missing URL', async () => {
await expect(executeWebhook()).rejects.toThrow('Invalid URL')
expect(true).toBe(true)
})
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
flags:
description: 'Message flags'
required: false
wait:
description: 'Whether Discord should wait for confirmation of message send before responding to the webhook request'
required: false
default: "true"
username:
description: 'The username that should appear to send the message. Note: username will have the "bot" badge next to their name.'
required: false
Expand Down Expand Up @@ -72,5 +76,5 @@ inputs:
description: 'Embed author icon'
required: false
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
Loading

0 comments on commit ba39ddf

Please sign in to comment.