Skip to content

Commit 0494431

Browse files
Zachary-wWclaude
andcommitted
ci: add issue notification workflow
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 175ff12 commit 0494431

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This directory contains the CI/CD workflows for LoongForge.
1212
| `build.yml` | PR + push to master | Build sdist + wheel on Python 3.10 / 3.12 |
1313
| `submodule-sync.yml` | repository dispatch / workflow dispatch + manual | Sync `third_party/Loong-Megatron` to its tracked branch and push the submodule pointer update |
1414
| `auto-label.yml` | Issue/PR open/edit | Auto-label issues and PRs by keyword matching |
15+
| `issue-notify.yml` | Issue opened | Notify Ruliu group when a new issue is opened |
1516

1617
All workflows support `workflow_dispatch` for manual re-runs from the Actions UI (except `auto-label.yml`).
1718

@@ -46,3 +47,11 @@ Required secrets:
4647
- `SUBMODULE_SYNC_APP_PRIVATE_KEY`
4748

4849
The GitHub App behind those secrets must be able to push to the configured target branch.
50+
51+
## Ruliu Issue Notifications
52+
53+
`issue-notify.yml` sends a Markdown message to a Ruliu group when a new GitHub Issue is opened. It runs on the self-hosted Linux runner because the Ruliu webhook host is only reachable from the internal network.
54+
55+
Required secret:
56+
57+
- `RULIU_ISSUE_WEBHOOK`: Ruliu group robot webhook URL for issue notifications.

.github/workflows/issue-notify.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Issue Notify
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
issue-notify:
12+
name: Notify Ruliu on new issue
13+
runs-on: [self-hosted, Linux, X64]
14+
env:
15+
RULIU_ISSUE_WEBHOOK: ${{ secrets.RULIU_ISSUE_WEBHOOK }}
16+
ISSUE_TITLE: ${{ github.event.issue.title }}
17+
ISSUE_NUMBER: ${{ github.event.issue.number }}
18+
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
19+
ISSUE_URL: ${{ github.event.issue.html_url }}
20+
REPOSITORY: ${{ github.repository }}
21+
steps:
22+
- name: Notify via Ruliu group
23+
run: |
24+
if [ -z "${RULIU_ISSUE_WEBHOOK:-}" ]; then
25+
echo "RULIU_ISSUE_WEBHOOK 未配置,跳过通知"
26+
exit 0
27+
fi
28+
29+
CONTENT=$(cat <<EOF
30+
##### LoongForge Issue 通知
31+
**Repo**: ${REPOSITORY}
32+
**Issue**: #${ISSUE_NUMBER} ${ISSUE_TITLE}
33+
**Author**: ${ISSUE_AUTHOR}
34+
**Link**: ${ISSUE_URL}
35+
EOF
36+
)
37+
PAYLOAD=$(jq -n --arg content "$CONTENT" '{message:{body:[{type:"MD",content:$content}]}}')
38+
39+
curl -sS -X POST "$RULIU_ISSUE_WEBHOOK" \
40+
-H 'Content-Type: application/json' \
41+
-d "$PAYLOAD" || echo "如流 Issue 通知发送失败(不影响主流程)"

0 commit comments

Comments
 (0)