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