Skip to content

Body not formatted as markdown #461

@arelstone

Description

@arelstone

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existsquestionFurther information is requestedserver-side issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions