Skip to content

Commit 1887b0a

Browse files
authored
Merge pull request #1025 from Sage-Bionetworks/develop-slackReleasebot
Added a slack bot to notify successful new releases
2 parents f55bf4c + b348473 commit 1887b0a

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,29 @@ jobs:
9292
# publish to pypi
9393
#----------------------------------------------
9494
- name: Publish package to Pypi
95+
id: publish-to-pypi
9596
if: steps.check-tag.outputs.match == 'true'
9697
env:
9798
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
9899
PYPI_USERNAME: __token__
99100
run: |
100-
poetry publish --build --username $PYPI_USERNAME --password $PYPI_TOKEN
101+
poetry publish --build --username $PYPI_USERNAME --password $PYPI_TOKEN
102+
103+
#----------------------------------------------
104+
# post a message to slack
105+
#----------------------------------------------
106+
107+
- name: Post to a Slack channel
108+
if: steps.publish-to-pypi.outcome == 'success'
109+
id: slack
110+
uses: slackapi/slack-github-action@v1.23.0
111+
with:
112+
# Slack channel id, channel name, or user id to post message.
113+
# See also: https://api.slack.com/methods/chat.postMessage#channels
114+
# You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs.
115+
# ibc-fair-data channel and data-curator-schematic channel
116+
channel-id: 'C01HSSMPQBG,C01ANC02U59'
117+
# For posting a simple plain text message
118+
slack-message: "Schematic has just been released. Check out new version: ${{ github.ref_name }}"
119+
env:
120+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)