From 1dc36cf64bc585a6491060b44490b8df0004b38b Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Mon, 12 Jan 2026 04:35:33 +1000 Subject: [PATCH] feat: add GitHub Action for daily Discord summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Runs daily at 9 AM UTC via cron - Can be triggered manually via workflow_dispatch - Uses date-based conversation ID (discord-summary-YYYY-MM-DD) - Triggers the Discord agent to read and summarize the past 24 hours Requires DISCORD_AGENT_ID secret to be set in GitHub repo settings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/discord-summary.yml | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/discord-summary.yml diff --git a/.github/workflows/discord-summary.yml b/.github/workflows/discord-summary.yml new file mode 100644 index 0000000..a87a36b --- /dev/null +++ b/.github/workflows/discord-summary.yml @@ -0,0 +1,42 @@ +name: Discord Daily Summary + +on: + schedule: + # Run daily at 9 AM UTC + - cron: '0 9 * * *' + workflow_dispatch: + # Allow manual trigger + +jobs: + post-summary: + runs-on: ubuntu-latest + steps: + - name: Generate conversation ID with date + id: conv-id + run: | + # Create a date-based conversation ID like "discord-summary-2026-01-11" + CONV_ID="discord-summary-$(date -u +%Y-%m-%d)" + echo "conv_id=$CONV_ID" >> $GITHUB_OUTPUT + echo "Generated conversation ID: $CONV_ID" + + - name: Trigger Discord Summary Agent + run: | + echo "Triggering agent with conversation: ${{ steps.conv-id.outputs.conv_id }}" + + # POST to the agent conversation endpoint + RESPONSE=$(curl -s -X POST \ + "https://tpmjs.com/api/agents/${{ secrets.DISCORD_AGENT_ID }}/conversation/${{ steps.conv-id.outputs.conv_id }}" \ + -H "Content-Type: application/json" \ + -d '{ + "message": "Read the Discord server (guild ID 1349727923434815519) for the past 24 hours, excluding bots. Then post a detailed summary with an embed to channel 1442666515425132644. Include key discussions, announcements, and any action items." + }' \ + --max-time 300) + + echo "Response received" + # The response is SSE, so we just check if we got something back + if [ -z "$RESPONSE" ]; then + echo "Error: No response from agent" + exit 1 + fi + + echo "Summary triggered successfully"