flavorjones / irc-notification-resource

Concourse CI resource for sending notifications to IRC.
Other
4 stars 2 forks source link

Allow escape codes for color formatting messages #15

Open kallisti5 opened 4 years ago

kallisti5 commented 4 years ago

You can't directly put escape codes into the pipeline yaml, (you get "error: yaml: control characters are not allowed")

but irc-notification-resource could translate escaped colors for you using a common method. https://github.com/myano/jenni/wiki/IRC-String-Formatting

Example:

# Jobs
jobs:
  - name: haiku-((branch))-((arch))
    public: true
    on_success:
      put: irc
      params:
        message: \x0303((branch)) build of ((arch)) was successful!\x0F ${BUILD_URL}
    on_failure:
      put: irc
      params:
        message: \x0304((branch)) build of ((arch)) failed!\x0F ${BUILD_URL}
    plan:

It looks like it wouldn't be super hard to "search for \xYY in a message and change it to 0xYY in the string.

kallisti5 commented 4 years ago

irc