Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix Discord text truncation
Joseph T. Lyons76191fe47de4
diff --git a/.github/workflows/release_actions.yml b/.github/workflows/release_actions.ymlindex 54e5d07787f..c1df24a8e5c 100644--- a/.github/workflows/release_actions.yml+++ b/.github/workflows/release_actions.yml@@ -6,34 +6,28 @@ jobs:discord_release:runs-on: ubuntu-lateststeps:- - name: Get appropriate URL- id: get-appropriate-url+ - name: Get release URL+ id: get-release-urlrun: |if [ "${{ github.event.release.prerelease }}" == "true" ]; then- url="https://zed.dev/releases/preview/latest"+ URL="https://zed.dev/releases/preview/latest"else- url="https://zed.dev/releases/stable/latest"- fi- 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+ URL="https://zed.dev/releases/stable/latest"fi+ echo "::set-output name=URL::$URL"+ - name: Get content+ uses: 2428392/[email protected]+ id: get-content+ with:+ stringToTruncate: |+ 📣 Zed ${{ github.event.release.tag_name }} was just released!- echo "::set-output name=content::$text"+ Restart your Zed or head to ${{ steps.get-release-url.outputs.URL }} to grab it.+ ${{ github.event.release.body }}+ maxLength: 2000- name: Discord Webhook Actionuses: tsickert/[email protected]with:webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}- content: ${{ steps.prepare-content.outputs.content }}+ content: ${{ steps.get-content.outputs.string }}