CircleCI-Public / slack-orb

Create custom Slack notifications for CircleCI job statuses
https://circleci.com/developer/orbs/orb/circleci/slack
MIT License
214 stars 206 forks source link

Custom mention #51

Closed take closed 4 years ago

take commented 5 years ago

Hi thanks for implementing this 😄

Was wondering if we can change the mentions parameter based on the author.

I want to notify the user who has triggered the job :eyes:

Thanks,

Supernats commented 5 years ago

I am also trying to implement this. Have you had any luck, @take?

take commented 5 years ago

nope :( @Supernats

Supernats commented 5 years ago

I figured out how to hack this together and I have something working. I'll put up a gist in a bit.

Supernats commented 5 years ago

@take here's a Gist showing what ended up working for me. I set up a context that sets one environment variable per team member.

The variables look like this:

"#{PREFIX}#{GITHUB_USERNAME}"

The values are the Slack UID.

I wrote a simple Ruby utility to let me map from them easily, because I didn't feel like messing with chained dereferencing in Bash. I hope this helps!

https://gist.github.com/Supernats/781e6239690834b391f098624a4f8530

RajatGarg97 commented 5 years ago

Hi guys I got here from hactoberfest. Pl. guide me how can I contribute here.

Supernats commented 5 years ago

@RajatGarg97 I'd ask @KyleTryon directly.

KyleTryon commented 5 years ago

Hello @RajatGarg97 please check out our Orbtoberfest page here with full details: https://hacktoberfest.circleci.com/#/

Here are some resources to get started.

Basics:  Writing YAML: https://circleci.com/docs/2.0/writing-yaml/#section=configuration  Getting Started: https://circleci.com/docs/2.0/getting-started/  Configuration Reference: https://circleci.com/docs/2.0/configuration-reference/#section=configuration

Orb Registry:  https://circleci.com/orbs/registry/

Orb Docs:  Landing page: https://circleci.com/orbs/  Orb configuration reference: https://circleci.com/docs/2.0/reusing-config/#section=configuration  How to use an orb: https://circleci.com/docs/2.0/orb-intro/#using-circleci-orbs  

Orb Authoring:  Orb Starter Kit (preferred): https://github.com/CircleCI-Public/orb-starter-kit  Creating an orb via the CLI: https://circleci.com/docs/2.0/creating-orbs/#using-the-cli-to-publish-orbs

Examples:  Sumologic:   Registry: https://circleci.com/orbs/registry/orb/circleci/sumologic   GitHub: https://github.com/CircleCI-Public/sumologic-orb  AWS-Serverless:   Registry: https://circleci.com/orbs/registry/orb/circleci/aws-serverless   GitHub: https://github.com/CircleCI-Public/aws-serverless-orb  Hello-World:   The starter kit comes with some Hello-World starter code: https://github.com/CircleCI-Public/orb-starter-kit/tree/master/src

For any other comments or questions relating to hacktoberfest/orbtoberfest on CircleCI please feel free to join the conversation on our forum:https://discuss.circleci.com/t/participate-in-hacktoberfest-on-circleci

RajatGarg97 commented 5 years ago

Thanks @KyleTryon

the-pat commented 4 years ago

If @RajatGarg97 doesn't want this issue, I'm interested in taking a swing at it.