Skip to content

Commit 67acd8e

Browse files
chore: use reusable workflows from sdkman/.github (#53)
Co-authored-by: chloe41427[bot] <263185818+chloe41427[bot]@users.noreply.github.com>
1 parent f13e383 commit 67acd8e

File tree

2 files changed

+4
-68
lines changed

2 files changed

+4
-68
lines changed

.github/workflows/chloe-triage.yml

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,5 @@ on:
1010

1111
jobs:
1212
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

.github/workflows/notify-on-failure.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,5 @@ on:
88

99
jobs:
1010
notify:
11-
name: "Notify Chloé"
12-
runs-on: ubuntu-latest
13-
if: github.event.workflow_run.conclusion == 'failure'
14-
steps:
15-
- name: Notify Chloé
16-
env:
17-
REPO: ${{ github.repository }}
18-
WORKFLOW: ${{ github.event.workflow_run.name }}
19-
RUN_URL: ${{ github.event.workflow_run.html_url }}
20-
HOOK_URL: ${{ secrets.OPENCLAW_HOOK_URL }}
21-
HOOK_TOKEN: ${{ secrets.OPENCLAW_HOOK_TOKEN }}
22-
run: |
23-
TEXT="❌ ${WORKFLOW} failed: ${REPO}"
24-
TEXT+=$'\nRun: '"${RUN_URL}"
25-
PAYLOAD=$(jq -n --arg text "$TEXT" '{text: $text, mode: "now"}')
26-
WAKE_URL="${HOOK_URL%/agent}/wake"
27-
curl -sf -X POST \
28-
-H "Authorization: Bearer ${HOOK_TOKEN}" \
29-
-H "Content-Type: application/json" \
30-
-d "$PAYLOAD" \
31-
"$WAKE_URL"
11+
uses: sdkman/.github/.github/workflows/reusable-notify-on-failure.yml@main
12+
secrets: inherit

0 commit comments

Comments
 (0)