|
| 1 | +name: Notify Chloé (Issue Triage) |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + issue_comment: |
| 7 | + types: [created] |
| 8 | + |
| 9 | +jobs: |
| 10 | + notify: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + if: github.event.sender.type != 'Bot' |
| 13 | + steps: |
| 14 | + - name: Send to OpenClaw |
| 15 | + env: |
| 16 | + EVENT_NAME: ${{ github.event_name }} |
| 17 | + REPO: ${{ github.repository }} |
| 18 | + SENDER: ${{ github.event.sender.login }} |
| 19 | + ISSUE_NUMBER: ${{ github.event.issue.number }} |
| 20 | + ISSUE_TITLE: ${{ github.event.issue.title }} |
| 21 | + ISSUE_URL: ${{ github.event.issue.html_url }} |
| 22 | + ISSUE_BODY: ${{ github.event.issue.body }} |
| 23 | + COMMENT_BODY: ${{ github.event.comment.body }} |
| 24 | + COMMENT_URL: ${{ github.event.comment.html_url }} |
| 25 | + HOOK_URL: ${{ secrets.OPENCLAW_HOOK_URL }} |
| 26 | + HOOK_TOKEN: ${{ secrets.OPENCLAW_HOOK_TOKEN }} |
| 27 | + run: | |
| 28 | + if [ "$EVENT_NAME" = "issues" ]; then |
| 29 | + MSG="New issue in ${REPO} — #${ISSUE_NUMBER}: ${ISSUE_TITLE}" |
| 30 | + MSG+=$'\nAuthor: '"${SENDER}" |
| 31 | + MSG+=$'\nURL: '"${ISSUE_URL}" |
| 32 | + MSG+=$'\n\n'"${ISSUE_BODY}" |
| 33 | + else |
| 34 | + MSG="New comment on ${REPO} — #${ISSUE_NUMBER}: ${ISSUE_TITLE}" |
| 35 | + MSG+=$'\nFrom: '"${SENDER}" |
| 36 | + MSG+=$'\nURL: '"${COMMENT_URL}" |
| 37 | + MSG+=$'\n\n'"${COMMENT_BODY}" |
| 38 | + fi |
| 39 | + PAYLOAD=$(jq -n \ |
| 40 | + --arg message "$MSG" \ |
| 41 | + --arg name "GitHub Triage" \ |
| 42 | + '{message: $message, name: $name, deliver: true, channel: "discord", to: "1474759623209783327"}') |
| 43 | + curl -sf -X POST \ |
| 44 | + -H "Authorization: Bearer ${HOOK_TOKEN}" \ |
| 45 | + -H "Content-Type: application/json" \ |
| 46 | + -d "$PAYLOAD" \ |
| 47 | + "$HOOK_URL" |
0 commit comments