Update create-ready-for-testing-message.yml

This commit is contained in:
Bas van den Berg 2025-05-30 22:52:07 +02:00 committed by GitHub
parent 0c82638721
commit fc6601ff73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,8 +118,16 @@ jobs:
-H "Content-Type: application/json" \
-d "$JSON_PAYLOAD")
HTTP_BODY=$(echo "$RESPONSE" | head -n -1)
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
THREAD_ID=$(echo "$HTTP_BODY" | jq -r '.id')
STATUS_CODE=$(echo "$RESPONSE" | tail -n 1)
if [ "$STATUS_CODE" -eq 201 ]; then
if [[ "$HTTP_CODE" == "201" && -n "$THREAD_ID" ]]; then
LOCK_RESPONSE=$(curl -s -X PATCH "https://discord.com/api/v10/channels/$THREAD_ID" \
-H "Authorization: Bot $DISCORD_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"locked": true}')
echo "Discord post created successfully!"
else
echo "Response: $RESPONSE"