-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line breaks and lists in message #94
Comments
Hi @m-ibot Thank you for using this action and for your feedback. I tested this action with updating the tests to list and the formatting looks fine like in this screenshot. The examples are in here and here. Could you try out again from your end. Make sure to enclose the entire formatting in double quotes. If it doesn't work, can you send me the message that you send(the sensitive info masked of course) and i can try it out from my end. |
Hi @neonidian, thank you for your help. I was able to format messages. Workflow-Definition: name: Send MS Teams message
on:
workflow_dispatch:
jobs:
send-messages:
name: Send Messages to MS Teams
runs-on: ubuntu-latest
steps:
- name: single-fail
uses: neonidian/teams-notify-build-status@v4
with:
webhookUrl: ${{ secrets.TEAMS_MESSAGE_WEBHOOK }}
title: 'One line message: without quotes'
status: failure
message: Hello World!\n\n1. Foo\r2. Bar\n\nEnd
- name: single-success
uses: neonidian/teams-notify-build-status@v4
with:
webhookUrl: ${{ secrets.TEAMS_MESSAGE_WEBHOOK }}
title: 'One line message: with quotes'
status: success
message: "Hello World!\n\n1. Foo\r2. Bar\n\nEnd"
- name: multi-fail
uses: neonidian/teams-notify-build-status@v4
with:
webhookUrl: ${{ secrets.TEAMS_MESSAGE_WEBHOOK }}
title: 'Multi line message: Not enough line breaks!'
status: failure
message: >-
Hello World!
1. Foo
3. Bar
End.
- name: multi-success
uses: neonidian/teams-notify-build-status@v4
with:
webhookUrl: ${{ secrets.TEAMS_MESSAGE_WEBHOOK }}
title: 'Multi line message: Add enough line breaks!'
status: success
message: >-
Hello World!
1. Foo
2. Bar
End. The quotes were important when writing the message in a single line. When using the multi-line message definition in the workflow file I needed to add one more line break than I would usually do when writing markdown and that's also one more than I would expect based on the documentation about card formats from MS. But that's currently not an issue for me. Therefore I'd close this issue. Thanks again for your support! |
Hello!
First, I want to tell I really like this action! I migrated to it because it Microsoft disabled the MS-Teams connectors and I needed to switch to the workflow solution with Adaptive Cards. This action displays build information really nice!
There is only one thing and I'm not sure if it is a bug or if I do not escape characters correctly.
To display the message, you use a
TextBlock
element:teams-notify-build-status/src/payload/customize-card/CustomizeCard.js
Lines 117 to 121 in 2dd97e3
Based on the Microsoft documentation, several markdown formats are supported by
TextBlock
s in Adaptive cards: Format cards with MarkdownWhile I was able to use bold, italic and hyper links, I was not able to use list (ordered and unordered) or line breaks in the message block. Lists items were all displayed in one line and the line break characters (
\r
,\n
,\n\n
) were displayed in the message.Is this a feature this is currently not supported by this action (If so, would this be a possible enhancement?) or do I need some special escaping?
Thank you and best regards!
The text was updated successfully, but these errors were encountered: