Skip to content

Update announcement.yml #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions .github/workflows/announcement.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
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:
- name: Extract released packages
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
Expand All @@ -31,7 +41,6 @@ jobs:
cat release_links.html
echo "EOF"
} >> "$GITHUB_ENV"


- name: Send Telegram Message
uses: appleboy/telegram-action@master
Expand All @@ -41,9 +50,8 @@ jobs:
format: html
message: |
🚀 <b><a href="https://github.com/${{ github.repository }}">${{ github.repository }}</a></b> was just released!

📦 <b>Released Packages:</b>
${{ env.RELEASE_LINKS }}

🔗 PR: <a href="${{ github.event.pull_request.html_url }}"><b>${{ github.event.pull_request.title }}</b>#${{ github.event.pull_request.number }}</a>




🔗 PR: <a href="${{ inputs.pr_url }}"><b>${{ inputs.pr_title }}</b> #${{ inputs.pr_number }}</a>
15 changes: 15 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}