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@v1.2.0
20      id: get-content
21      with:
22        stringToTruncate: |
23          📣 Zed ${{ github.event.release.tag_name }} was just released!
24
25          Restart your Zed or head to ${{ steps.get-release-url.outputs.URL }} to grab it.
26
27          ${{ github.event.release.body }}
28        maxLength: 2000
29    - name: Discord Webhook Action
30      uses: tsickert/discord-webhook@v5.3.0
31      with:
32        webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
33        content: ${{ steps.get-content.outputs.string }}