Skip to content

Instantly share code, notes, and snippets.

View josh-stillman's full-sized avatar

Josh Stillman josh-stillman

View GitHub Profile
@josh-stillman
josh-stillman / slackbot.sh
Last active December 3, 2020 21:01
GitLab Slackbot Script. Posts daily MRs to Slack to keep environments in sync. Blog here: https://medium.com/giant-machines/slackbot-to-the-rescue-keeping-gitlab-branches-in-sync-with-a-slackbot-ff84f80eaf5f
#!/usr/bin/env bash
# Function that will be called for each repo. Script exectuion begins below.
handle_repo () {
#1. Set up variables.
local REPO=$1 # first function argument
local PROJECT_ID=$2 # second function argument
local SOURCE_BRANCH_DISPLAY=${3:-"QA"} # default value
local TARGET_BRANCH_DISPLAY=${4:-"Dev"} # default value