WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Discord Triage Cron #95

Discord Triage Cron

Discord Triage Cron #95

name: Discord Triage Cron
permissions:
contents: none
on:
schedule:
# Run every day at 12:00 PM UTC
- cron: '0 12 * * *'
workflow_dispatch: # Allow manual triggering
jobs:
discord-triage:
runs-on: ubuntu-latest
steps:
- name: Create workflow run and execute
run: |
# Create the workflow run and capture the runId
response=$(curl -s 'https://shrilling-scarce-finland.mastra.cloud/api/workflows/discordToGithubWorkflow/create-run' \
-X 'POST' \
-H 'Authorization: Bearer ${{ secrets.MASTRA_TRIAGE_JWT_KEY }}' \
-H 'Referer: https://cloud.mastra.ai/' \
-H 'User-Agent: Github Action')
# Extract runId from the response
runId=$(echo "$response" | jq -r '.runId')
if [ "$runId" != "null" ] && [ -n "$runId" ]; then
echo "Created workflow run with ID: $runId"
# Follow-up request using the runId
echo "Starting workflow with runId: $runId"
start_response=$(curl --max-time 300 "https://shrilling-scarce-finland.mastra.cloud/api/workflows/discordToGithubWorkflow/start?runId=$runId" \
-X 'POST' \
-H 'Authorization: Bearer ${{ secrets.MASTRA_TRIAGE_JWT_KEY }}' \
-H 'Referer: https://cloud.mastra.ai/' \
-H 'User-Agent: Github Action' \
-H 'Content-Type: application/json' \
--data-raw '{"inputData":{"forumChannelId":"1349006916902191125","fetchLimit":1},"requestContext":{}}')
echo "Workflow start response:"
echo "$start_response" | jq .
else
echo "Failed to get runId from response: $response"
exit 1
fi