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@e6b5885fb83c81ca9a700a91b079baec2133be3e # v1.4.0
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@c840d45a03a323fbc3f7507ac7769dbd91bfb164 # v5.3.0
32 with:
33 webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
34 content: ${{ steps.get-content.outputs.string }}