community_release_actions.yml

 1name: Release Actions
 2
 3on:
 4  release:
 5    types: [published]
 6
 7jobs:
 8  discord_release:
 9    runs-on: ubuntu-latest
10    steps:
11      - name: Get release URL
12        id: get-release-url
13        run: |
14          if [ "${{ github.event.release.prerelease }}" == "true" ]; then
15            URL="https://zed.dev/releases/preview/latest"
16          else
17            URL="https://zed.dev/releases/stable/latest"
18          fi
19          echo "::set-output name=URL::$URL"
20      - name: Get content
21        uses: 2428392/gh-truncate-string-action@b3ff790d21cf42af3ca7579146eedb93c8fb0757 # v1.4.1
22        id: get-content
23        with:
24          stringToTruncate: |
25            📣 Zed [${{ github.event.release.tag_name }}](<${{ steps.get-release-url.outputs.URL }}>) was just released!
26
27            ${{ github.event.release.body }}
28          maxLength: 2000
29          truncationSymbol: "..."
30      - name: Discord Webhook Action
31        uses: tsickert/discord-webhook@86dc739f3f165f16dadc5666051c367efa1692f4 # v6.0.0
32        with:
33          webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
34          content: ${{ steps.get-content.outputs.string }}
35          flags: 4 # suppress embeds - https://discord.com/developers/docs/resources/message#message-object-message-flags