slackapi / slackapi/slack-github-action

Body not formatted as markdown

Open
#461 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug duplicate question server-side issue
Dominant language
JavaScript
Stars
1.3k
Forks
200
Avg merge
2h 59m
Merged PRs (30d)
6

Description

When creating a release using the auto generated release notes, which is markdown. The body ${{ github.release.event.body }} is not being formatted as expected

Workflow
on:
  release:
    types: 
      - released
      - prereleased
jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - run: echo "${{ github.event.release.body || 'No release body provided' }}"
        shell: bash
      - run: |
          echo "Release event detected: ${{ github.event_name }}"
          echo "Release name: ${{ github.event.release.name || github.event.release.tag_name }}"
          echo "Release body: ${{ github.event.release.body }}"
          echo "Release URL: ${{ github.event.release.html_url }}"
          echo "Release is a pre-release: ${{ github.event.release.prerelease }}"
          echo "Workflow run ID: ${{ github.run_id }}"
          echo "Repository: ${{ github.repository }}"
          echo "Server URL: ${{ github.server_url }}"
          

      - name: Send Slack Notification
        uses: slackapi/slack-github-action@v2.1.0
        with:
          webhook-type: incoming-webhook
          webhook: "${{ secrets.SLACK_WEBHOOK_URL }}"
          payload: |
            text: "🚀 🔖 ✨ Release notice ${{ github.event.release.name || github.event.release.tag_name }} ✨ 🔖 🚀"
            blocks:
              - type: "section"
                text:
                  type: "mrkdwn"
                  text: "*🚀 🔖 ✨ Release notice ${{ github.event.release.name || github.event.release.tag_name }} ✨ 🔖 🚀*"
              - type: "context"
                elements: 
                  - type: "mrkdwn"
                    text: "*Build for*: ${{ github.event.release.prerelease && 'Stage' || 'Production' }}"
                  - type: "mrkdwn"
                    text: "*Version*: ${{ github.event.release.tag_name }}"
              - type: "divider"
              - type: "section"
                text: 
                  type: "mrkdwn"
                  text: "${{ github.event.release.body }}"
              - type: "divider"
              - type: "context"
                elements: 
                  - type: "mrkdwn"
                    text: "<${{ github.event.release.html_url }}|*Full Changelog*>"
                  - type: "mrkdwn"
                    text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow Run>"      
Expected:
Image
Recieved:
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided release-triggered workflow and inspect how the action handles the release body in the Slack payload. Compare the rendered result with the expected and received screenshots; done means the generated release notes appear with the intended formatting in the notification.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.