Skip to content

Commit

Permalink
add ping role input
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Apr 28, 2024
1 parent fbd51e3 commit a435507
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ inputs:
thumbnail-url:
description: 'The URL of the thumbnail to use'
required: false
ping-notification-role:
description: 'Whether to ping the notification role'
required: false
default: 'true'
notification-role-id:
description: 'The role ID to ping'
required: false
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export async function run(): Promise<void> {

const thumbnailUrl = core.getInput('thumbnail-url', { required: false })

let shouldPingRole = 'false' !== (core.getInput('ping-notification-role', { required: false }) || 'true').toLowerCase();

Check failure on line 70 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

'shouldPingRole' is never reassigned. Use 'const' instead

Check failure on line 70 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `·'false'·!==·(core.getInput('ping-notification-role',·{·required:·false·})·||·'true').toLowerCase();` with `⏎······'false'·!==⏎······(⏎········core.getInput('ping-notification-role',·{·required:·false·})·||·'true'⏎······).toLowerCase()`

Check failure on line 70 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Extra semicolon

let notificationRole = core.getInput('notification-role-id', {
required: false
})
Expand Down Expand Up @@ -129,7 +131,7 @@ export async function run(): Promise<void> {
core.setOutput('message', result)

// ping the announcements role
if (notificationRole) {
if (shouldPingRole && notificationRole) {
core.debug(`Pinging role ${notificationRole}`)
await webhook.send({
...avatar,
Expand Down

0 comments on commit a435507

Please sign in to comment.