Skip to content

Commit d6de48a

Browse files
authored
Update announcement.yml
1 parent 609834f commit d6de48a

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

.github/workflows/announcement.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,35 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14+
- name: Extract released packages
15+
id: extract
16+
run: |
17+
REPO="https://github.com/${{ github.repository }}"
18+
echo "${{ github.event.pull_request.body }}" > pr_body.md
19+
20+
# Extract all lines starting with '## '
21+
grep '^## ' pr_body.md | sed 's/^## //' > packages.txt
22+
23+
# Generate HTML list of links to releases
24+
while read -r line; do
25+
ENCODED_TAG=$(echo "$line" | jq -sRr @uri) # encode the tag for URL safety
26+
echo "• <a href=\"$REPO/releases/tag/$ENCODED_TAG\">$line</a>"
27+
done < packages.txt > release_links.html
28+
29+
{
30+
echo "RELEASE_LINKS<<EOF"
31+
cat release_links.html
32+
echo "EOF"
33+
} >> "$GITHUB_ENV"
34+
1435
- name: Send Telegram Message
1536
uses: appleboy/telegram-action@master
1637
with:
1738
to: ${{ secrets.TELEGRAM_TO }}
1839
token: ${{ secrets.TELEGRAM_TOKEN }}
1940
format: html
2041
message: |
21-
🚀 <b>New Release for <a href="https://github.com/${{ github.repository }}">Design System</a>!</b>
22-
23-
🔗 <a href="${{ github.event.pull_request.html_url }}">View PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}</a>
24-
25-
📦 You can also check all of the <a href="https://github.com/${{ github.repository }}/releases">releases</a>
42+
🚀 <b>New Release for <a href="https://github.com/${{ github.repository }}">Design System</a>!</b>\n
43+
🔗 <a href="${{ github.event.pull_request.html_url }}">View PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}</a>\n
44+
📦 <b>Released Packages:</b>\n
45+
${{ env.RELEASE_LINKS }}

0 commit comments

Comments
 (0)