appleboy/telegram-action

Sending formatted message

eelzinaty opened this issue · 4 comments

First thanks for the great work you did, it helps a lot.
I want to ask if there is away to send a formatted message? i.e. markdown
Tried this example but it did not work for me

- name: New deployment started
        uses: appleboy/telegram-action@master
        with:
          to: 11111
          token: xxxxx
          format: markdown
          message: |+
                    **Service**               
                    ${{github.repository}}
                    ** Owner **
                    ${{github.actor}}
                    <b>Event</b>                 
                    ${{github.event_name}}
                    _Ref_    
                    ${{github.ref}}
                    **SHA**
                    ${{github.sha}}        
                    **Message**
                    ${{env.commitmsg}} 
                    **Repo Action URL**
                    [Link](https://github.com/${{github.repository_owner}}/${{github.repository}}/actions/runs/${{github.run_id}}) 

Here are the result of my tests. Hope it helps:

  • bold: use single star sign *bold*
  • monospace: Use single backtick for inline monospace, and three-backticks for dedicated line monospace
args: "Text, and `inline monospace text` same line"
args: "Text, and ```dedicated line monospace``` separated lines"
  • italic: no clue; fails with _italic_ and __italic__
  • new-line: good old \n new-line character
  • new message: a comma ,, whereas \, does not escape command and breaks the workflow
args: "one message, another message"
  • hyperlink: good old [text](link)

@eelzinaty If you manage to send your message, consider closing this issue. ;)

Please refer to the markdown style link