Skip to content

Instantly share code, notes, and snippets.

@minwoox
minwoox / git-trigger-build.sh
Created May 11, 2021 09:11 — forked from trustin/git-trigger-build.sh
git-trigger-build: Triggers a CI build by pushing an empty commit
#!/bin/bash -e
# Stash the staged files if any.
NEEDS_UNSTASH=0
if ! git diff --staged --exit-code >/dev/null; then
echo -ne '\033[1;32m'
echo -n 'Stashing the staged files'
echo -e '\033[0m'
git stash
NEEDS_UNSTASH=1