Skip to content

Commit aeb33a7

Browse files
authored
ci: add announcement (#2877)
1 parent 1006cab commit aeb33a7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/announce.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on:
2+
release:
3+
types:
4+
- published
5+
jobs:
6+
slack:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Get tag
10+
id: get_tag
11+
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
12+
- name: Get version
13+
id: get_version
14+
run: echo "VERSION=${TAG##v}" >> $GITHUB_OUTPUT
15+
env:
16+
TAG: ${{ steps.get_tag.outputs.TAG }}
17+
- name: Prepare message
18+
id: get_message
19+
run: echo "MSG=${{ secrets.SLACK_MESSAGE }}" >> $GITHUB_OUTPUT
20+
env:
21+
VERSION: ${{ steps.get_version.outputs.VERSION }}
22+
TAG: ${{ steps.get_tag.outputs.TAG }}
23+
RELEASE_URL: "https://github.com/scaleway/scaleway-cli/releases/tag/${{ steps.get_tag.outputs.TAG }}"
24+
- name: Announce on slack
25+
id: announce_slack
26+
run: |
27+
readarray -td' ' URL_LIST <<<$SLACK_WEBHOOKS;
28+
for WEBHOOK_URL in ${URL_LIST[@]};
29+
do curl -X POST -H 'Content-type: application/json' \
30+
--data '{
31+
"blocks": [
32+
{
33+
"type": "section",
34+
"text": {
35+
"type": "mrkdwn",
36+
"text": "'"${MESSAGE}"'"
37+
}
38+
}
39+
]
40+
}' \
41+
${WEBHOOK_URL};
42+
done
43+
env:
44+
SLACK_WEBHOOKS: ${{ secrets.SLACK_WEBHOOKS }}
45+
MESSAGE: ${{ steps.get_message.outputs.MSG }}

0 commit comments

Comments
 (0)