Skip to content

Commit 9c74870

Browse files
marc0derclaude
andcommitted
feat: standardise triage callers on reusables
- normalize triage-events trigger to pull_request (was pull_request_target) - replace broken inlined fork-PR workflow with the reusable caller Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 961b164 commit 9c74870

3 files changed

Lines changed: 8 additions & 46 deletions

File tree

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
name: Notify Chloé (Issue Triage)
2-
1+
name: "Triage: Issues, Comments, PRs"
32
on:
43
issues:
54
types: [opened]
65
issue_comment:
76
types: [created]
8-
pull_request_target:
7+
pull_request:
98
types: [opened]
10-
119
jobs:
1210
notify:
13-
uses: sdkman/.github/.github/workflows/reusable-triage.yml@main
11+
uses: sdkman/.github/.github/workflows/reusable-triage-events.yml@main
1412
secrets: inherit
Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,9 @@
1-
name: Triage on Fork PR Completion
2-
3-
# Only triggers on fork PRs (external contributors)
4-
# Runs in base repo context with full secret access
1+
name: "Triage: Fork PR"
52
on:
63
workflow_run:
74
workflows: ["Pull Requests"]
85
types: [completed]
9-
106
jobs:
117
triage:
12-
runs-on: ubuntu-latest
13-
if: github.event.workflow_run.head_repository.fork == true
14-
steps:
15-
- name: Send fork PR triage notification
16-
env:
17-
HOOK_URL: ${{ secrets.OPENCLAW_HOOK_URL }}
18-
HOOK_TOKEN: ${{ secrets.OPENCLAW_HOOK_TOKEN }}
19-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
run: |
21-
# Fetch PR details from completed workflow
22-
PR_DATA=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }} \
23-
--jq '.pull_requests[0] | {number, title, html_url, user: .head.user.login}')
24-
25-
PR_NUMBER=$(echo "$PR_DATA" | jq -r '.number // empty')
26-
[ -z "$PR_NUMBER" ] && exit 0
27-
28-
PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
29-
PR_URL=$(echo "$PR_DATA" | jq -r '.html_url')
30-
PR_AUTHOR=$(echo "$PR_DATA" | jq -r '.user')
31-
32-
MSG="PR #${PR_NUMBER}: ${PR_TITLE}"$'\n'"Author: ${PR_AUTHOR}"$'\n'"URL: ${PR_URL}"
33-
34-
PAYLOAD=$(jq -n \
35-
--arg message "$MSG" \
36-
--arg name "GitHub Triage" \
37-
'{message: $message, name: $name, deliver: true, channel: "discord", to: "1474759623209783327"}')
38-
39-
curl -sf -X POST \
40-
-H "Authorization: Bearer ${HOOK_TOKEN}" \
41-
-H "Content-Type: application/json" \
42-
-d "$PAYLOAD" \
43-
"$HOOK_URL"
8+
uses: sdkman/.github/.github/workflows/reusable-triage-fork-pr.yml@main
9+
secrets: inherit
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
name: Notify on Failure
2-
1+
name: Workflow Failure Alert
32
on:
43
workflow_run:
54
workflows: ["*"]
65
branches: [master, main]
76
types: [completed]
8-
97
jobs:
108
notify:
11-
uses: sdkman/.github/.github/workflows/reusable-notify-on-failure.yml@main
9+
uses: sdkman/.github/.github/workflows/reusable-workflow-failure-alert.yml@main
1210
secrets: inherit

0 commit comments

Comments
 (0)