Skip to content

Commit 6c1a47e

Browse files
authored
Merge pull request #18 from code-with-amirhossein/amir78729-patch-19
Update announcement.yml
2 parents 57d5af8 + 4f59a1e commit 6c1a47e

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

.github/workflows/announcement.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
name: Notify Telegram on Release Merge
1+
name: 📣 Announcement
22

33
on:
4-
pull_request:
5-
types: [closed]
6-
branches: [main]
4+
workflow_call:
5+
inputs:
6+
pr_title:
7+
required: true
8+
type: string
9+
pr_number:
10+
required: true
11+
type: string
12+
pr_url:
13+
required: true
14+
type: string
15+
pr_body:
16+
required: true
17+
type: string
718

819
jobs:
9-
telegram:
10-
if: github.event.pull_request.merged == true
20+
telegram-announcement:
1121
runs-on: ubuntu-latest
1222

1323
steps:
1424
- name: Extract released packages
1525
id: extract
1626
run: |
1727
REPO="https://github.com/${{ github.repository }}"
18-
echo "${{ github.event.pull_request.body }}" > pr_body.md
28+
echo "${{ inputs.pr_body }}" > pr_body.md
1929
2030
# Extract all lines starting with '## '
2131
grep '^## ' pr_body.md | sed 's/^## //' > packages.txt
@@ -31,7 +41,6 @@ jobs:
3141
cat release_links.html
3242
echo "EOF"
3343
} >> "$GITHUB_ENV"
34-
3544
3645
- name: Send Telegram Message
3746
uses: appleboy/telegram-action@master
@@ -41,9 +50,8 @@ jobs:
4150
format: html
4251
message: |
4352
🚀 <b><a href="https://github.com/${{ github.repository }}">${{ github.repository }}</a></b> was just released!
53+
54+
📦 <b>Released Packages:</b>
4455
${{ env.RELEASE_LINKS }}
45-
46-
🔗 PR: <a href="${{ github.event.pull_request.html_url }}"><b>${{ github.event.pull_request.title }}</b>#${{ github.event.pull_request.number }}</a>
47-
48-
49-
56+
57+
🔗 PR: <a href="${{ inputs.pr_url }}"><b>${{ inputs.pr_title }}</b> #${{ inputs.pr_number }}</a>

.github/workflows/deploy.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,18 @@ jobs:
7474
- name: "🚀 deploy to github pages"
7575
id: deployment
7676
uses: actions/deploy-pages@v4
77+
78+
79+
announcement:
80+
name: 📣 Announcement
81+
needs: build
82+
uses: ./.github/workflows/announcement.yml
83+
with:
84+
pr_title: ${{ github.event.head_commit.message }}
85+
pr_number: ${{ needs.changesets.outputs.pr }}
86+
pr_url:
87+
https://github.com/${{ github.repository }}/pull/${{
88+
needs.changesets.outputs.pr }}
89+
pr_body: |
90+
${{ github.event.head_commit.message }}
91+

0 commit comments

Comments
 (0)