Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions discord/create-thread/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ inputs:
description: "Name of the Discord thread to be created"
default: "Default Thread Name"

secrets:
discord_bot_token:
description: "Discord bot token with permissions to create threads"
default: "."
Expand All @@ -26,8 +27,8 @@ runs:
id: create_thread
shell: bash
env:
DISCORD_TOKEN: ${{ inputs.discord_bot_token }}
CHANNEL_ID: ${{ inputs.discord_channel_id }}
DISCORD_TOKEN: ${{ secrets.discord_bot_token }}
CHANNEL_ID: ${{ secrets.discord_channel_id }}
THREAD_NAME: ${{ inputs.thread_name }}
run: |
# Create the thread and capture the response
Expand Down
20 changes: 11 additions & 9 deletions discord/post-message/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ name: "Post Discord Message"
description: "Post a message in a Discord channel"

inputs:
message_content:
description: "Content of the message to post"
default: ""

message_embeds:
description: "Embeds to include in the message (JSON format)"
default: ""

secrets:
discord_channel_id:
description: "Discord channel ID where the message will be posted"
default: "false"
Expand All @@ -10,13 +19,6 @@ inputs:
description: "Discord bot token with permissions to post messages"
default: "."

message_content:
description: "Content of the message to post"
default: ""

message_embeds:
description: "Embeds to include in the message (JSON format)"
default: ""
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -47,11 +49,11 @@ runs:
echo "PAYLOAD=$PAYLOAD" >> $GITHUB_ENV
- name: Post message to Discord channel
env:
DISCORD_TOKEN: ${{ inputs.discord_bot_token }}
DISCORD_TOKEN: ${{ secrets.discord_bot_token }}
shell: bash
run: |
# Post the message
MESSAGE_RESPONSE=$(curl -s -X POST "https://discord.com/api/v10/channels/${{ inputs.discord_channel_id }}/messages" \
MESSAGE_RESPONSE=$(curl -s -X POST "https://discord.com/api/v10/channels/${{ secrets.discord_channel_id }}/messages" \
-H "Authorization: Bot $DISCORD_TOKEN" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
Expand Down