Skip to content

Conversation

@gperalta-ductworks
Copy link

Sends Slack alerts when errors occur in CircleCI jobs.

Description

Ensure teams are notified in real time about failures in CircleCI pipelines. This reduces response time, helps identify issues quickly, and improves pipeline reliability.
Adds Slack alert integration that posts error notifications from CircleCI pipelines directly to configured Slack channels.

How was it tested? What documentation was provided?

Verified by running failing jobs in CircleCI and confirming that Slack alerts were triggered with the correct error details in the target channel. Successful runs were also checked to ensure no false alerts.

Documentation: A minimal README with environment variable setup (CIRCLE_TOKEN, SLACK_ACCESS_TOKEN, SLACK_DEFAULT_CHANNEL) and instructions for enabling the Slack integration in

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@Goncalo-Almeida Goncalo-Almeida self-requested a review September 26, 2025 15:43
Copy link
Collaborator

@fireboy1919 fireboy1919 Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're not passing along the actual message describing what failed and instead using global fails. Did you try doing it the same way that it's currently working (i.e., each step has it's own fail handler and a message describing how it's failing)?

That seems like a better approach if it works via slack.

exit 1
name: Send alerts to slack when something fails
when: on_fail
#Clone the repo to be sure that script circleci_pipeline_metadata.sh is always available.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up debug code.

@gperalta-ductworks
Copy link
Author

@fireboy1919 and @Goncalo-Almeida all changes were applied and tested. Please can you review.

@gperalta-primehire
Copy link
Collaborator

Just in case @Goncalo-Almeida @fireboy1919 please don't merge, first we need to configure Circle-CI Env. variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants