Limited-time
Free Asset, Solar, and Wind Webinar (Sept 18th)
Sign up

Better Google Cloud Build notifications in Slack

STEVE GATTUSO
June 3, 2025

Being a remote-first company, Amperon uses Slack liberally to communicate amongst our team. Recently our engineering team has also started leveraging Slack for chatops, or the ability to monitor and react to what’s happening in our systems within Slack in realtime and plain view of the whole team.

One particularly important piece of our chatops infrastructure are build notifications. Given that we deploy multiple times per day, it’s important to know if there are any issues with new changes. Our CI/CD suite is built on Google Cloud Build, and if you’ve worked with GCB in the past you may have noticed that its integrations with external services are pretty lacking. Today we’re going to focus on improving on on specific integration that is pretty lackluster out of the box: forwarding build failure notifications to Slack.

If you follow Google Cloud’s official article detailing how to set this up, you’ll be left with a notification like this:

That’s… not too helpful. If you have different builds running on different branches, different triggers for different flows (think continuous integration vs continuous deployment), and use something like GitHub to manage your code, this integration leaves a lot to be desired.

Luckily it’s not too hard to spruce this up a bit and end up with a notification that looks like this:

This notification provides quite a bit more insight into what went wrong: you get the commit hash, branch name, and specific step in the build that failed. I’ve also found the links super helpful to quickly jump to information I need in order to figure out what went wrong and how to fix it.

Thankfully this improved notification doesn’t require any additional setup beyond Google’s official documentation for setting up a slack notification, it just requires you to swap out the lackluster cloud function code their tutorial provides with the following:

Just make sure you’ve replaced the GH_ORG_NAME constant with your GitHub organization’s name (ie https://github.com/stevenleeg would need to be stevenleeg) and your Google Cloud Platform project ID in GCP_PROJECT_ID.

Note that this particular implementation only notifies on build failures, not build successful runs. If you’re looking to add in successful build reports you should be able to modify this by removing the BAD_STATUSES check. Feel free to get creative with the resulting slack message too. I’d highly recommend checking out Slack’s block kit builder to make the design process a bit easier. GCB’s Build.BuildStep documentation is also very helpful to know what information you have at your disposal in the build argument of createSlackMessage.

Happy hacking!

Related articles

News
August 25, 2025
Amperon Receives Strategic Investment from Acario to Advance Energy Forecasting Innovation
Open article
News
June 3, 2025
Amperon Releases Real-Time Price Forecast in ERCOT
Open article
News
June 3, 2025
Amperon’s AI-Powered Forecasts Now Available on the Yes Energy Platform
Open article
News
June 3, 2025
Amperon Secures Strategic Investment from National Grid Partners to Accelerate AI-powered Energy Forecasting Solutions
Open article
News
June 3, 2025
Amperon Unveils Advanced Wind Forecasting Solutions to Optimize Renewable Energy Operations
Open article
News
June 3, 2025
Amperon Launches AI-Powered Price Forecasting
Open article
News
June 3, 2025
Amperon Launches Asset-Level Renewable Energy Generation Forecasts
Open article
News
June 3, 2025
Amperon Launches AI-Driven Energy Forecasting on Snowflake Marketplace
Open article
News
June 3, 2025
Amperon Expands into Europe with AI-Powered Energy Forecasting Services
Open article
News
June 3, 2025
Amperon joins global climate initiative 24/7 Carbon-Free Energy Compact
Open article
News
June 3, 2025
Amperon wins 2024 CleanTech Breakthrough Award for AI Innovation
Open article
News
June 3, 2025
Amperon featured on Time's America's Top GreenTech Companies 2024 list
Open article
News
June 3, 2025
Amperon Collaborates with Microsoft to Accelerate AI Adoption for Power & Utilities Companies
Open article
News
June 3, 2025
Amperon is named in AD50: AI Edition
Open article
News
June 3, 2025
Amperon Partners with Hometown Connections to Bring Better Forecasting Analytics to Public Power Utilities
Open article
News
June 3, 2025
Amperon Raises $20 Million Series B to Accelerate Energy Analytics and Grid Decarbonization
Open article
News
June 3, 2025
Amperon launches 25% more accurate net demand forecasts
Open article
News
June 3, 2025
​​Amperon partners with WattTime to help accelerate the decarbonization of the electric grid
Open article
News
June 3, 2025
Notation capital leads Amperon pre-seed round
Open article
News
June 3, 2025
Amperon wins global energy forecasting competition
Open article
News
June 3, 2025
Amperon makes urban future prize competition finals
Open article
News
June 3, 2025
Data science team to present at International Conference of Machine Learning (ICML)
Open article
News
June 3, 2025
The trillion dollar opportunity in grid decarbonization
Open article
News
June 3, 2025
Amperon announces $2M seed round
Open article
News
June 3, 2025
Amperon demonstrates commitment to security and resilience with SOC 2 Type II compliance
Open article
News
June 3, 2025
Amperon raises $7 million Series A led by HSBC Asset Management
Open article
News
June 3, 2025
Amperon names Tim Healy and Catherine Flax to join board of directors
Open article