Lambda function to handle Bitbucket webhook payloads, extract relevant information and send notifications to Microsoft Teams

Related tags

Miscellaneous PR-Bot
Overview

PR-Bot

Lambda function to handle Bitbucket webhook payloads, extract relevant information, and send notifications to Microsoft Teams, saving you time on opening PR review requests manually.

Example of the notification

Prerequisites

Before using this PR-Bot, ensure you have the following prerequisites installed and configured:

  • Rust: The programming language used to build the Lambda function. Installation Guide
  • AWS CLI (optional but recommended): This will save time during deployment. Installation Guide
  • Cargo Lambda: A tool for building Rust AWS Lambda functions. For more documentation, please refer to Cargo Lambda
  • Microsoft Teams: Access to a Microsoft Teams channel where you want to receive notifications.
  • BitBucket Account / Repo: The scope from where you will be sending notifications to Microsoft Teams.

Configuration

Microsoft Teams Webhook

  1. Configure a webhook in your Microsoft Teams channel where you want to receive notifications. Take note of the generated webhook URL.

Lambda Function Configuration

  1. Clone this repository to your local environment.

  2. Change TEAM_URL with your webhook from Microsoft Teams or set it as an env variable in Lambda.

  3. Open the template.json file and update the CHANNEL_ID with the correct channel ID in the correct format.

    To find the correct ID, go to Microsoft Teams channel, extract URL from the channel. The ID you need will be in the format of <some numbers>:<some more numbers>@thread.tacv2. Other channels may have a similar format, but the ending could be @thread.skype. Update the ID in the code.

  4. Modify the deploy.sh script to ensure that it has the appropriate role permissions for AWS Lambda. It is also possible to manually upload the zip file to Lambda from AWS Console.

Usage

To generate a zip file:

cargo lambda build --release --output-format zip

And to upload from CLI:

./deploy.sh

After the Lambda function is uploaded to AWS, create an API gateway. Copy the link and paste it in your webhoooks on BitBucket, when triggered you will receive a card in Microsoft Teams.

I highly advise you to increase the function timeout ( I have set it to 8 seconds )

Thank you to leon3s [https://github.com/leon3s] for his assistance and creativity

You might also like...
📜 A pci.ids-compliant library for getting information about available PCI devices.

aparato A pci.ids-compliant library for getting information about available PCI devices. Usage Add the following to your project's Cargo.toml file: ap

use variant nesting information to flter overlapping sites from vg deconstruct output

vcfbub popping bubbles in vg deconstruct VCFs overview The VCF output produced by a command like vg deconstruct -e -a -H '#' ... includes information

A stringly-typed Error that includes `#[track_caller]` information.

A stringly-typed Error that includes #[track_caller] information.

Memory.lol - a tiny web service that provides historical information about social media accounts

memory.lol Overview This project is a tiny web service that provides historical information about social media accounts. It can currently be used to l

A Rust proc-macro crate which derives functions to compile and parse back enums and structs to and from a bytecode representation

Bytecode A simple way to derive bytecode for you Enums and Structs. What is this This is a crate that provides a proc macro which will derive bytecode

A library and tool for automata and formal languages, inspired by JFLAP
A library and tool for automata and formal languages, inspired by JFLAP

Sugarcubes is a library and application for automata and formal languages. It is inspired by JFLAP, and is intended to eventually to be an alternative to JFLAP.

A stupid macro that compiles and executes Rust and spits the output directly into your Rust code

inline-rust This is a stupid macro inspired by inline-python that compiles and executes Rust and spits the output directly into your Rust code. There

This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity.
This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity.

bottom-bot This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity. Ever had this pro

An implementation of Code Generation and Factoring for Fast Evaluation of Low-order Spherical Harmonic Products and Squares

sh_product An implementation of Code Generation and Factoring for Fast Evaluation of Low-order Spherical Harmonic Products and Squares (paper by John

Owner
Irine
my cortisol level goes up every time I introduce concurrency to my Rust programs
Irine
A Rust-based dropper for shellcode payloads.

A Rust-based dropper for shellcode payloads.

Michael Taggart 20 Dec 5, 2022
A webhook-based Discord slash command library

Slashook A webhook-based Discord slash command library. This is a WIP project. Please note breaking changes can occur within minor releases until vers

Tonkku 11 Oct 18, 2022
🥅 Dead simple webhook worker for Sentry to output events in a Discord channel

?? Sentry Webhook Dead simple webhook worker for Sentry to output events in a Discord channel Why? This is just a simple Rust HTTP service to do so, t

Noel 5 Nov 7, 2022
A Github webhook server to help with CI/CD written in Rust.

This application will automatically updates local GitHub repositories and triggers a command once the update is complete. This can be extremely useful

Luca 9 Apr 4, 2023
Announce blogs and send emails. Originally built for ConnectDome.

ConnectDome - Rust Notify A simple service to announce new blogs on your Slack/Discord + send emails to your list via your TES. Feature 1: Posts blogs

ConnectDome 3 May 8, 2022
A Discord bot to send updates on queries in tori.fi

torimies-rs How the bot works? The bot works by making requests to the undocumented (and very bad) tori.fi api endpoint. The users can add and remove

Luukas Pörtfors 19 Dec 29, 2022
A Discord bot to send updates on queries in tori.fi

torimies-rs How the bot works? The bot works by making requests to the undocumented (and very bad) tori.fi api endpoint. The users can add and remove

Testausserveri ry 19 Dec 29, 2022
Easy-to-use optional function arguments for Rust

OptArgs uses const generics to ensure compile-time correctness. I've taken the liberty of expanding and humanizing the macros in the reference examples.

Jonathan Kelley 37 Nov 18, 2022
Simplistic complier~virtual-machine that transforms AST into a Rust function, with basic type checking

rast-jit-vm rast-jit-vm is a simplistic, proof-of-concept~ish compiler / virtual machine that transforms syntax tree into a Rust function, type-checki

Patryk Wychowaniec 4 Oct 23, 2022
Uradhura is a telegram bot that fetches information and media from reddit

Pathetic little Telegram bot that fetches information from Reddit posts(with gif, image(post with single image) and video)

The Penguins Org 3 May 28, 2022