Skip to content

Commit a073673

Browse files
committed
add .github/workflows/issue.yml
1 parent b9ee07d commit a073673

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/issue.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Created Notification
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
discussions:
7+
types: [created]
8+
9+
jobs:
10+
notify-on-issue-created:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 5
13+
steps:
14+
- name: Send issue
15+
if: github.event_name == 'issues'
16+
run: |
17+
echo "GIT_LINK=${{ github.event.issue.html_url }}" >> $GITHUB_ENV
18+
echo "GIT_TITLE=${{ github.event.issue.title }}" >> $GITHUB_ENV
19+
echo "GIT_BODY=${{ github.event.issue.body }}" >> $GITHUB_ENV
20+
- name: Send discussion
21+
if: github.event_name == 'discussions'
22+
run: |
23+
echo "GIT_LINK=${{ github.event.discussion.html_url }}" >> $GITHUB_ENV
24+
echo "GIT_TITLE=${{ github.event.discussion.title }}" >> $GITHUB_ENV
25+
echo "GIT_BODY=${{ github.event.discussion.body }}" >> $GITHUB_ENV
26+
27+
- name: Create Article
28+
uses: jiacai2050/telegraph-action@v1
29+
id: telegraph
30+
with:
31+
token: ${{ secrets.TELEGRAPH_TOKEN }}
32+
title: "${{ env.GIT_TITLE }}"
33+
message: "${{ env.GIT_BODY }}"
34+
author-name: "ZigCC Team"
35+
author-url: "${{ env.GIT_LINK }}"
36+
37+
- name: Send Telegram Message
38+
uses: jiacai2050/telegram-action@v1
39+
with:
40+
token: ${{ secrets.TELEGRAM_TOKEN }}
41+
chat-id: "@zig_cc"
42+
message: "${{ steps.telegraph.outputs.url }}"

0 commit comments

Comments
 (0)