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 }}](${{ steps.get-release-url.outputs.URL }}) was just released!
24
25 ${{ github.event.release.body }}
26 maxLength: 2000
27 - name: Discord Webhook Action
28 uses: tsickert/discord-webhook@v5.3.0
29 with:
30 webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
31 content: ${{ steps.get-content.outputs.string }}