Skip to content

Instantly share code, notes, and snippets.

View DanielArndt's full-sized avatar

Daniel Arndt DanielArndt

View GitHub Profile
@DanielArndt
DanielArndt / linkJiraIssuesInSlack.js
Last active November 9, 2017 18:08
Tampermonkey script to override the build message function in slack to replace JIRA issue IDs with links.
// ==UserScript==
// @name Slack to Jira links
// @namespace ca.arndt.dan.slack.jiralinks
// @version 1
// @description JIRA links in Slack
// @include https://*.slack.com/*
// @run-at document-end
// @grant unsafeWindow
// ==/UserScript==
#!/bin/bash
contains_element () {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
protected_branches=("master" "develop")
# check each branch being pushed
while read local_ref local_sha remote_ref remote_sha