diff --git a/.github/workflows/announcement.yml b/.github/workflows/announcement.yml
index c79a3c8..a3fee22 100644
--- a/.github/workflows/announcement.yml
+++ b/.github/workflows/announcement.yml
@@ -1,13 +1,23 @@
-name: Notify Telegram on Release Merge
+name: 📣 Announcement
on:
- pull_request:
- types: [closed]
- branches: [main]
+ workflow_call:
+ inputs:
+ pr_title:
+ required: true
+ type: string
+ pr_number:
+ required: true
+ type: string
+ pr_url:
+ required: true
+ type: string
+ pr_body:
+ required: true
+ type: string
jobs:
- telegram:
- if: github.event.pull_request.merged == true
+ telegram-announcement:
runs-on: ubuntu-latest
steps:
@@ -15,7 +25,7 @@ jobs:
id: extract
run: |
REPO="https://github.com/${{ github.repository }}"
- echo "${{ github.event.pull_request.body }}" > pr_body.md
+ echo "${{ inputs.pr_body }}" > pr_body.md
# Extract all lines starting with '## '
grep '^## ' pr_body.md | sed 's/^## //' > packages.txt
@@ -31,7 +41,6 @@ jobs:
cat release_links.html
echo "EOF"
} >> "$GITHUB_ENV"
-
- name: Send Telegram Message
uses: appleboy/telegram-action@master
@@ -41,9 +50,8 @@ jobs:
format: html
message: |
🚀 ${{ github.repository }} was just released!
+
+ 📦 Released Packages:
${{ env.RELEASE_LINKS }}
-
- 🔗 PR: ${{ github.event.pull_request.title }}#${{ github.event.pull_request.number }}
-
-
-
+
+ 🔗 PR: ${{ inputs.pr_title }} #${{ inputs.pr_number }}
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index e8b90a7..a88d84b 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -74,3 +74,18 @@ jobs:
- name: "🚀 deploy to github pages"
id: deployment
uses: actions/deploy-pages@v4
+
+
+ announcement:
+ name: 📣 Announcement
+ needs: build
+ uses: ./.github/workflows/announcement.yml
+ with:
+ pr_title: ${{ github.event.head_commit.message }}
+ pr_number: ${{ needs.changesets.outputs.pr }}
+ pr_url:
+ https://github.com/${{ github.repository }}/pull/${{
+ needs.changesets.outputs.pr }}
+ pr_body: |
+ ${{ github.event.head_commit.message }}
+