Skip to content

Commit ba59c33

Browse files
authored
Merge pull request #4646 from google/release-webhook
discord release webhook
2 parents f18baf0 + 9e4d3e3 commit ba59c33

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/flax_publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,28 @@ jobs:
4242
run: ls -l dist/
4343
- name: Publish package distributions to PyPI
4444
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
45+
46+
discord_release:
47+
if: github.repository_owner == 'google'
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Get release URL
51+
id: get-release-url
52+
run: |
53+
URL="https://github.com/google/flax/releases"
54+
echo "::set-output name=URL::$URL"
55+
- name: Get content
56+
uses: 2428392/gh-truncate-string-action@b3ff790d21cf42af3ca7579146eedb93c8fb0757 # v1.4.1
57+
id: get-content
58+
with:
59+
stringToTruncate: |
60+
Flax [${{ github.event.release.tag_name }}](<${{ steps.get-release-url.outputs.URL }}>) was just released!
61+
62+
${{ github.event.release.body }}
63+
maxLength: 2000
64+
truncationSymbol: "..."
65+
- name: Discord Webhook Action
66+
uses: tsickert/discord-webhook@c840d45a03a323fbc3f7507ac7769dbd91bfb164 # v5.3.0
67+
with:
68+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
69+
content: ${{ steps.get-content.outputs.string }}

0 commit comments

Comments
 (0)