Skip to content

Kkhandale2024/slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner

Slack Notifier

With our comprehensive DevOps toolkit - streamline operations, automate workflows, enhance collaboration and, most importantly, deploy with confidence.


Slack Notifier

This custom Slack notifier sends tailored notifications to a Slack channel, allowing full customization of the message content based on specific triggers or events. You can configure various inputs to personalize the notification, including the status of tasks, outcomes, and additional fields such as organization links, file URLs, and custom data.

Inputs

Command-line argument Default Description
SLACK_WEBHOOK_URL Set up when creating the Slack webhook Required. Your Slack Webhook URL for sending notifications
SLACK_USERNAME CloudDrovebot The username that will appear as the sender in Slack
SLACK_CHANNEL general The Slack channel where the message will be sent
SLACK_COLOR #008000 The color of the message's left border in Slack
SLACK_ICON_URL Bot Avatar The URL for the icon to display with the message
MESSAGE Build completed successfully! The content of the message to be sent to Slack
REPO_ACTION_URL ${{ github.server_url }}/${{ github.repository }}/actions URL to your repository's GitHub Actions page
DEPLOYMENT_URL https://example.com/deployment URL to the deployment or organization website
FOOTER CloudDrove Footer text displayed at the bottom of the message
FOOTER_ICON https://avatars.githubusercontent.com/u/45422299?s=200&v=4 The icon that appears next to the footer
ORG_URL https://your-organization.com URL to your organization’s website
FILE_URL ${{ env.FILE_URL }} URL to any relevant file you want to link in the message
SLACK_ICON_EMOJI ':rocket:' Emoji icon used instead of SLACK_ICON_URL in the message
CUSTOM_FIELD_1_TITLE "Environment" Title for the first custom field
CUSTOM_FIELD_1_VALUE "Staging" Value for the first custom field
CUSTOM_FIELD_1_SHORT "true" Whether the first custom field should be displayed in short format
CUSTOM_FIELD_2_TITLE "Version" Title for the second custom field
CUSTOM_FIELD_2_VALUE "v1.2.3" Value for the second custom field
CUSTOM_FIELD_2_SHORT "true" Whether the second custom field should be displayed in short format
CUSTOM_FIELD_3_TITLE "Service" Title for the third custom field
CUSTOM_FIELD_3_VALUE "Authentication" Value for the third custom field
CUSTOM_FIELD_3_SHORT "false" Whether the third custom field should be displayed in short format
CUSTOM_FIELD_4_TITLE "Region" Title for the fourth custom field
CUSTOM_FIELD_4_VALUE "us-east-1" Value for the fourth custom field
CUSTOM_FIELD_4_SHORT "true" Whether the fourth custom field should be displayed in short format

Usage

You can use this action after any other action in your workflow. Here's an example of how to set it up:

  1. Create a .github/workflows/slack-notify.yml file in your GitHub repository and add the following code to it.
name: Slack Notify

on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  slackNotification:
    name: Slack Notification
    runs-on: ubuntu-latest
    steps:
    - name: Send Slack Notification
      uses: clouddrove-sandbox/slack_notifier@master
      with:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
          MESSAGE: "Build completed successfully!"
          SLACK_USERNAME: Build Bot
          SLACK_ICON_EMOJI: ":rocket:"
          SLACK_CHANNEL: "#builds"
          SLACK_COLOR: "#00FF00"
          SLACK_ICON_URL: https://clouddrove.com/assets/images/logo.png
          REPO_ACTION_URL: "${{ github.server_url }}/${{ github.repository }}/actions"
          DEPLOYMENT_URL: "https://example.com/deployment"
          ORG_URL: 'https://your-organization.com'
          FILE_URL: ${{ env.FILE_URL }}
          CUSTOM_FIELD_1_TITLE: "Environment"
          CUSTOM_FIELD_1_VALUE: "Staging"
          CUSTOM_FIELD_1_SHORT: "true"
          FOOTER: 'CloudDrove' 
          FOOTER_ICON: "https://avatars.githubusercontent.com/u/45422299?s=200&v=4" 

✨ Contributors

Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward.



If you're considering contributing to our project, here are a few quick guidelines that we have been following (Got a suggestion? We are all ears!):

  • Fork the Repository: Create a new branch for your feature or bug fix.
  • Coding Standards: You know the drill.
  • Clear Commit Messages: Write clear and concise commit messages to facilitate understanding.
  • Thorough Testing: Test your changes thoroughly before submitting a pull request.
  • Documentation Updates: Include relevant documentation updates if your changes impact it.

Feedback

Spot a bug or have thoughts to share with us? Let's squash it together! Log it in our issue tracker, feel free to drop us an email at [email protected].

Show some love with a ★ on our GitHub! if our work has brightened your day! – your feedback fuels our journey!

🚀 Our Accomplishment

We have 100+ Terraform modules 🙌. You could consider them finished, but, with enthusiasts like yourself, we are able to ever improve them, so we call our status - improvement in progress.

Join Our Slack Community

Join our vibrant open-source slack community and embark on an ever-evolving journey with CloudDrove; helping you in moving upwards in your career path. Join our vibrant Open Source Slack Community and embark on a learning journey with CloudDrove. Grow with us in the world of DevOps and set your career on a path of consistency.

🌐💬What you'll get after joining this Slack community:

  • 🚀 Encouragement to upgrade your best version.
  • 🌈 Learning companionship with our DevOps squad.
  • 🌱 Relentless growth with daily updates on new advancements in technologies.

Join our tech elites Join Now 🚀

Explore Our Blogs

Click here 📚 🌟

Tap into our capabilities

We provide a platform for organizations to engage with experienced top-tier DevOps & Cloud services. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud Solutions.

At CloudDrove, has extensive experience in designing, building & migrating environments, securing, consulting, monitoring, optimizing, automating, and maintaining complex and large modern systems. With remarkable client footprints in American & European corridors, our certified architects & engineers are ready to serve you as per your requirements & schedule. Write to us at [email protected].

We are The Cloud Experts!


We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.