How to extract user, branch, commit from a circle CI trigger?

Sorry for such a lazy question but I quickly wanted to know where to get these info from (or if they have to be configured)

My aim is to send out slack notification with these information after a certain ci step

Hi @sudipbhandari126!

You can get that information from the built-in environment variables.

  • user > CIRCLE_USERNAME

  • branch > CIRCLE_BRANCH

  • commit > CIRCLE_SHA1

Also, I recommend using the latest version of our Slack orb (version 4.0.0) which is simpler to use. You can find out more about this latest version on our blog.

1 Like