|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | notify: |
13 | | - runs-on: ubuntu-latest |
14 | | - if: github.event.sender.type != 'Bot' |
15 | | - steps: |
16 | | - - name: Send to OpenClaw |
17 | | - env: |
18 | | - EVENT_NAME: ${{ github.event_name }} |
19 | | - REPO: ${{ github.repository }} |
20 | | - SENDER: ${{ github.event.sender.login }} |
21 | | - ISSUE_NUMBER: ${{ github.event.issue.number }} |
22 | | - ISSUE_TITLE: ${{ github.event.issue.title }} |
23 | | - ISSUE_URL: ${{ github.event.issue.html_url }} |
24 | | - ISSUE_BODY: ${{ github.event.issue.body }} |
25 | | - COMMENT_BODY: ${{ github.event.comment.body }} |
26 | | - COMMENT_URL: ${{ github.event.comment.html_url }} |
27 | | - PR_NUMBER: ${{ github.event.pull_request.number }} |
28 | | - PR_TITLE: ${{ github.event.pull_request.title }} |
29 | | - PR_URL: ${{ github.event.pull_request.html_url }} |
30 | | - PR_BODY: ${{ github.event.pull_request.body }} |
31 | | - HOOK_URL: ${{ secrets.OPENCLAW_HOOK_URL }} |
32 | | - HOOK_TOKEN: ${{ secrets.OPENCLAW_HOOK_TOKEN }} |
33 | | - run: | |
34 | | - INSTRUCTION="Brief notification only. Provide: repo + number + title + author + one sentence summary + link. No assessment, no suggestions, no follow-up questions unless asked." |
35 | | - if [ "$EVENT_NAME" = "issues" ]; then |
36 | | - MSG="${INSTRUCTION}"$'\n\n'"New issue in ${REPO} — #${ISSUE_NUMBER}: ${ISSUE_TITLE}" |
37 | | - MSG+=$'\nAuthor: '"${SENDER}" |
38 | | - MSG+=$'\nURL: '"${ISSUE_URL}" |
39 | | - MSG+=$'\n\n'"${ISSUE_BODY}" |
40 | | - elif [ "$EVENT_NAME" = "pull_request" ]; then |
41 | | - MSG="${INSTRUCTION}"$'\n\n'"New PR in ${REPO} — #${PR_NUMBER}: ${PR_TITLE}" |
42 | | - MSG+=$'\nAuthor: '"${SENDER}" |
43 | | - MSG+=$'\nURL: '"${PR_URL}" |
44 | | - MSG+=$'\n\n'"${PR_BODY}" |
45 | | - else |
46 | | - MSG="${INSTRUCTION}"$'\n\n'"New comment on ${REPO} — #${ISSUE_NUMBER}: ${ISSUE_TITLE}" |
47 | | - MSG+=$'\nFrom: '"${SENDER}" |
48 | | - MSG+=$'\nURL: '"${COMMENT_URL}" |
49 | | - MSG+=$'\n\n'"${COMMENT_BODY}" |
50 | | - fi |
51 | | - PAYLOAD=$(jq -n \ |
52 | | - --arg message "$MSG" \ |
53 | | - --arg name "GitHub Triage" \ |
54 | | - '{message: $message, name: $name, deliver: true, channel: "discord", to: "1474759623209783327"}') |
55 | | - curl -sf -X POST \ |
56 | | - -H "Authorization: Bearer ${HOOK_TOKEN}" \ |
57 | | - -H "Content-Type: application/json" \ |
58 | | - -d "$PAYLOAD" \ |
59 | | - "$HOOK_URL" |
| 13 | + uses: sdkman/.github/.github/workflows/reusable-triage.yml@main |
| 14 | + secrets: inherit |
0 commit comments