Skip to content
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

Formatting issue via action #192

Closed
4 of 10 tasks
jackherizsmith opened this issue Apr 12, 2023 · 8 comments
Closed
4 of 10 tasks

Formatting issue via action #192

jackherizsmith opened this issue Apr 12, 2023 · 8 comments
Labels
question Further information is requested

Comments

@jackherizsmith
Copy link

jackherizsmith commented Apr 12, 2023

Description

Formatting from string created during action is being ignored

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version: 1.23.0

node version:

OS version(s): ubuntu-latest

Steps to reproduce:

  1. send string with mrkdwn formatting via webhook like "- thing 1\n- thing 2"

Expected result:

What you expected to happen

formatted:

  • thing 1
  • thing 2

Actual result:

unformatted:

- thing 1
- thing 2

Attachments:

Screenshot 2023-04-12 at 22 37 12

@jackherizsmith jackherizsmith changed the title Formatting issue Formatting issue via action Apr 12, 2023
@seratch seratch added the question Further information is requested label Apr 13, 2023
@seratch
Copy link
Member

seratch commented Apr 13, 2023

Hi @jackherizsmith, unfortunately, Slack's mrkdwn does not natively support markdown's list sytanx. As a workaround, you need to • item 1\n• item 2\n• item 3 or something like that. Also, we don't tell whether any enhancements regarding this can come in the future. I know the answer here is not great for you, but I hope this helps clarify.

@jackherizsmith
Copy link
Author

That's very helpful clarification - so assuming the more advanced <@U[SLACK_ID]> also won't work?

@jackherizsmith
Copy link
Author

jackherizsmith commented Apr 13, 2023

is there an alternative you can recommend, in order to get this formatting to work from a GitHub action?

@jackherizsmith
Copy link
Author

jackherizsmith commented Apr 13, 2023

I suppose rather than using this action, I could write a custom step that invokes curl?

@seratch
Copy link
Member

seratch commented Apr 13, 2023

The list syntax just does not exist. Any other syntax available here should work when using this GitHub action library. Please refer to https://github.com/slackapi/slack-github-action/tree/main/example-workflows too.

@jackherizsmith
Copy link
Author

ah I see interesting! so lists (bullet points) are specifically broken, and everything else should work as documented?

@ryan-williams
Copy link
Contributor

ryan-williams commented Jul 18, 2023

I'm using Technique 1: Slack Workflow Builder and not observing any formatting to work. That doc link says:

You can select where you want to post the data and how you want to format it in Slack's workflow builder interface.

but the Workflow Builder modal doesn't let me do much with the "variables" (e.g. can't use them in links or code fences). It seems to let me bold-face or italicize a "variable":

image

but even that doesn't work; everything is rendered without formatting:

slack gha post unformatted

Example GHA run:

Run slackapi/slack-github-action@v1.24.0
  with:
    payload: {
    "text": "Sample text, *bold1* **bold2** _italic_ `code` [link](https://github.com/slackapi/slack-github-action)\n```code fence```\n"
  }
  
  env:
    SLACK_WEBHOOK_URL: ***

@seratch when you said:

Any other syntax available here should work when using this GitHub action library.

is that supposed to apply to "Technique 1"?

@seratch
Copy link
Member

seratch commented Jul 19, 2023

@ryan-williams

is that supposed to apply to "Technique 1"?

No, any of Slack syntax does not work in Workflow Builder variables. I should have been more specific, but I meant, as long as you use incoming webhooks or chat.postMessage API to directly post a Slack message from your GitHub Actions job, any formatting syntax are available for it while they are not available for Workflow Builder integration.

@jackherizsmith Sorry for my late response here:

so lists (bullet points) are specifically broken, and everything else should work as documented?

All the syntax documented work as you expect.

Let me close this issue now 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants