release_actions.yml

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