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

Show the dependent / required job and commit message #363

Closed khteh closed 1 year ago

khteh commented 2 years ago

Describe Request:

Currently the slack notification message shows the name of this slack-orb job and commit hash value. It would be more usefule to be able to show the following: (1) The dependent / required job - The real job of build and/or deployment (2) The commit message.

Examples:

workflows:
  main:
    jobs:
      - build_deploy_app1:
          name: BuildDeployApp1
          filters:
            branches:
              only:
                - staging
                - master
      - app1_notification:
          name: App1CICD
          requires:
            - BuildDeployApp1

It should show BuildDeployApp1 job name and the commit message which triggered the workflow.

Supporting Documentation Links:

KyleTryon commented 1 year ago

Hello,

It is not possible to show dependent jobs in a workflow. All orbs, including the Slack orb, are only contextually aware of the singular job they are actively running in. You will need to customize your template to output the message you desire.

https://github.com/CircleCI-Public/slack-orb/wiki#custom-message-template