Skip to content

Instantly share code, notes, and snippets.

@su-shubham
Last active November 17, 2024 07:04
Show Gist options
  • Save su-shubham/d4c1d7cce2f147c46c8b2b1a3ebdcd9e to your computer and use it in GitHub Desktop.
Save su-shubham/d4c1d7cce2f147c46c8b2b1a3ebdcd9e to your computer and use it in GitHub Desktop.
github-incident-to-slack

πŸš€ GitHub Issues to Slack Notification Pipeline

Streamline your team's workflow and improve issue resolution with this automated pipeline. This pipeline continuously monitors GitHub for issues tagged as "bug" 🐞 or "enhancement" βš™οΈ, sends alerts to a Slack channel with detailed issue information, and generates an AI-based response with potential solutions. By integrating GitHub, Slack, and Cohere AI, your team can stay informed and resolve issues faster and more efficiently.

πŸ“„ Pipeline Overview

  1. Monitor GitHub: Keep track of issues labeled as "bug" or "enhancement" in your repository.
  2. Notify Slack: Alert your Slack channel with key details about the detected issue.
  3. Generate AI Suggestions: Use AI to generate a suggested solution to the issue.
  4. Share AI Response: Send the AI-generated response back to the Slack channel for team review.

πŸ› οΈ Components Breakdown

  1. GitHub Monitor Issues (github-monitor-issues):

    • Type: GitHub Component
    • Task: TASK_LIST_ISSUES
    • Function: Scans the repository for issues with specific labels.
  2. Slack Notify Issues (slack-notify-issues):

    • Type: Slack Component
    • Task: TASK_WRITE_MESSAGE
    • Function: Sends an alert to a specified Slack channel when an issue is found.
  3. AI Generate Response (ai-generate-response):

    • Type: Cohere Component
    • Task: TASK_TEXT_GENERATION_CHAT
    • Function: Creates a detailed AI-generated solution to the issue.
  4. Slack Send AI Suggestion (slack-send-ai-suggestion):

    • Type: Slack Component
    • Task: TASK_WRITE_MESSAGE
    • Function: Shares the AI-generated response in the Slack channel.

πŸ“Έ Visual Demo

Check out the visual representation of this workflow:

🌐 Live Demo Playground

Explore and test this pipeline in the Instill AI demo playground: GitHub Issues to Slack Pipeline Demo

πŸ”— Why Use Instill AI?

  • Comprehensive Integration: Easily integrate various data sources and applications like GitHub and Slack into a seamless pipeline.
  • AI-Powered Automation: Leverage AI capabilities to generate intelligent responses, speeding up your workflow.
  • User-Friendly Platform: Instill AI offers an intuitive interface and pre-built components that make building and managing pipelines a breeze.
  • Scalable Solutions: Whether you’re a small team or a large enterprise, Instill AI scales to fit your needs.

Learn more about how Instill AI can transform your workflows:

πŸ“¦ Variables

Variable Description Format UI Order
repository_owner The owner (username or organization) of the GitHub repository. string 1
repository_name The name of the GitHub repository to monitor. string 2
slack_channel_name The Slack channel where incident notifications will be sent. string 3

βš™οΈ Configuration Steps

1. Set Up Secrets

Before running the pipeline, ensure you have added the following secrets to your Instill AI project:

  • github-access-token: GitHub API token with repo or read:org permissions.
  • slack-bot-token: Slack bot token with chat:write permission.
  • cohere: Cohere API key for AI text generation.

2. Run the Pipeline

Use the Instill AI Pipeline Playground to execute the pipeline. Input the necessary variables (repository_owner, repository_name, slack_channel_name) and ensure the secrets are correctly configured.

πŸ“ Example Workflow

  1. Monitor: The pipeline starts by monitoring the specified GitHub repository for issues labeled "bug" or "enhancement."
  2. Notify: If an issue is detected, it triggers a Slack notification containing the issue details.
  3. AI Generate: The AI component produces a response with detailed suggestions for resolving the issue.
  4. Send AI Response: The generated response is sent back to Slack for your team to review and take action.

🚦 Important Notes

  • Permissions: Make sure your GitHub token has the necessary permissions (repo or read:org).
  • Slack Authorization: Your Slack bot token should include the chat:write permission.
  • Customization: You can customize the Cohere AI response settings as needed to better fit your use case.

Elevate your team's productivity and issue management with this fully automated, integrated pipeline, turning issue tracking and resolution into a seamless process.

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