Skip to content

Commit 1bb2c1c

Browse files
authored
Merge pull request #12 from code-with-amirhossein/amir78729-patch-12
Update announcement.yml
2 parents d9265fa + d6de48a commit 1bb2c1c

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

.github/workflows/announcement.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@ 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:
@@ -20,4 +41,5 @@ jobs:
2041
message: |
2142
🚀 <b>New Release for <a href="https://github.com/${{ github.repository }}">Design System</a>!</b>\n
2243
🔗 <a href="${{ github.event.pull_request.html_url }}">View PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}</a>\n
23-
📦 <a href="https://github.com/${{ github.repository }}/releases">Releases</a>
44+
📦 <b>Released Packages:</b>\n
45+
${{ env.RELEASE_LINKS }}

0 commit comments

Comments
 (0)