mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 19:10:24 +00:00
Truncate Discord release note text (#3112)
Hopefully this works the first time 😅
Release Notes:
- N/A
This commit is contained in:
commit
1a4e9ecfef
1 changed files with 20 additions and 9 deletions
29
.github/workflows/release_actions.yml
vendored
29
.github/workflows/release_actions.yml
vendored
|
@ -10,19 +10,30 @@ jobs:
|
||||||
id: get-appropriate-url
|
id: get-appropriate-url
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event.release.prerelease }}" == "true" ]; then
|
if [ "${{ github.event.release.prerelease }}" == "true" ]; then
|
||||||
URL="https://zed.dev/releases/preview/latest"
|
url="https://zed.dev/releases/preview/latest"
|
||||||
else
|
else
|
||||||
URL="https://zed.dev/releases/stable/latest"
|
url="https://zed.dev/releases/stable/latest"
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=URL::$URL"
|
echo "::set-output name=url::$url"
|
||||||
|
|
||||||
|
- name: Prepare release content
|
||||||
|
id: prepare-content
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
text="📣 Zed ${{ github.event.release.tag_name }} was just released!\n\nRestart your Zed or head to ${{ steps.get-appropriate-url.outputs.URL }} to grab it.\n\n${{ github.event.release.body }}"
|
||||||
|
|
||||||
|
maxTextLength=2000
|
||||||
|
truncationIndicator="..."
|
||||||
|
|
||||||
|
if (( ${#text} > maxTextLength )); then
|
||||||
|
text=${text:0:maxTextLength - ${#truncationIndicator}}$truncationIndicator
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "::set-output name=content::$text"
|
||||||
|
|
||||||
- name: Discord Webhook Action
|
- name: Discord Webhook Action
|
||||||
uses: tsickert/discord-webhook@v5.3.0
|
uses: tsickert/discord-webhook@v5.3.0
|
||||||
with:
|
with:
|
||||||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
content: |
|
content: ${{ steps.prepare-content.outputs.content }}
|
||||||
📣 Zed ${{ github.event.release.tag_name }} was just released!
|
|
||||||
|
|
||||||
Restart your Zed or head to ${{ steps.get-appropriate-url.outputs.URL }} to grab it.
|
|
||||||
|
|
||||||
${{ github.event.release.body }}
|
|
||||||
|
|
Loading…
Reference in a new issue