diff --git a/.github/workflows/loop-live-discord.yml b/.github/workflows/loop-live-discord.yml new file mode 100644 index 000000000000..007d90065e72 --- /dev/null +++ b/.github/workflows/loop-live-discord.yml @@ -0,0 +1,39 @@ +name: loop-live Discord feed + +# When the consensus loop auto-merges a PR in this fork, post a one-line notice +# to the Chrono AI Discord #loop-live feed via the NyxID proxy. +# +# Setup: add a repo secret NYX_DISCORD_KEY = a NyxID agent key scoped to the +# `chronoai-bot` service. The bot token itself is injected by NyxID, never stored +# here. The job is a no-op when the secret is absent. + +on: + pull_request: + types: [closed] + +jobs: + notify: + if: >- + github.event.pull_request.merged == true && + contains(join(github.event.pull_request.labels.*.name, ','), 'crnd:human:auto') + runs-on: ubuntu-latest + steps: + - name: Post merge to #loop-live + env: + NYX_DISCORD_KEY: ${{ secrets.NYX_DISCORD_KEY }} + PR_NUMBER: ${{ github.event.pull_request.number }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_URL: ${{ github.event.pull_request.html_url }} + REPO: ${{ github.repository }} + run: | + if [ -z "$NYX_DISCORD_KEY" ]; then + echo "NYX_DISCORD_KEY not set; skipping Discord notify." + exit 0 + fi + payload=$(jq -n --arg c "✅ Auto-merged **PR #${PR_NUMBER}** — ${PR_TITLE} (${REPO}) + ${PR_URL}" '{content: $c}') + curl -fsS -X POST \ + "https://nyx-api.chrono-ai.fun/api/v1/proxy/s/chronoai-bot-1738/channels/1518548271277281290/messages" \ + -H "X-API-Key: ${NYX_DISCORD_KEY}" \ + -H "Content-Type: application/json" \ + -d "$payload"