Skip to content

Commit 2394207

Browse files
authored
Add GitHub Actions workflow to notify Zulip on release
1 parent 45a897e commit 2394207

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Notify Zulip
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- name: Post announcement to Zulip
12+
env:
13+
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
14+
ZULIP_BOT_API_KEY: ${{ secrets.ZULIP_BOT_API_KEY }}
15+
ZULIP_SITE: ${{ secrets.ZULIP_SITE }}
16+
REPO: ${{ github.event.repository.name }}
17+
TAG: ${{ github.event.release.tag_name }}
18+
RELEASE_URL: ${{ github.event.release.html_url }}
19+
CHANGELOG: ${{ github.event.release.body }}
20+
run: |
21+
CONTENT=$(cat <<EOF
22+
**${REPO}** [${TAG}](${RELEASE_URL}) has been released 🎉
23+
24+
${CHANGELOG}
25+
EOF
26+
)
27+
28+
curl -sSf "${ZULIP_SITE}/api/v1/messages" \
29+
-u "${ZULIP_BOT_EMAIL}:${ZULIP_BOT_API_KEY}" \
30+
--data-urlencode type=stream \
31+
--data-urlencode "to=announcements" \
32+
--data-urlencode "topic=releases" \
33+
--data-urlencode "content=${CONTENT}"

0 commit comments

Comments
 (0)