Ilshidur / action-slack

🚀 (Unmaintained) GitHub Action that sends a Slack notification.

Home Page:https://github.com/marketplace/actions/github-action-for-slack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow defining fully custom message

radeksimko opened this issue · comments

There's currently no way to suppress the first line which prints name of repository and other details which might not always be desired:

text: `${process.env.GITHUB_REPOSITORY}/${process.env.GITHUB_WORKFLOW} triggered by ${process.env.GITHUB_ACTOR} (${process.env.GITHUB_EVENT_NAME}) :\n${compiled(process.env)}`,

I can create an env var that will prevent this, so you can fully customize your message.

Here some suggestions :

  • SLACK_OVERRIDE_MESSAGE
  • SLACK_NO_FIRST_LINE
  • SLACK_NO_INFO

What do you think ? 😄

I think the first option seems the most sensible as folks will be able to just stick with a single variable.

Working on it ...

Done.

You can override the message with the SLACK_OVERRIDE_MESSAGE environment variable :

  • set it to true to remove the first line (which you don't want).
  • set it to any other value to override the message in the args field.

Here's the commit : 2b45998. Therefore, you can use the action with this name : action-slack@2b45998.

Thank you for raising this issue. I'd be happy to have some feedback ;-)