Skip to content

Instantly share code, notes, and snippets.

@scottrigby
Created November 10, 2018 05:27
Show Gist options
  • Save scottrigby/e9970db8e7f7fcf6b5123773765f2b61 to your computer and use it in GitHub Desktop.
Save scottrigby/e9970db8e7f7fcf6b5123773765f2b61 to your computer and use it in GitHub Desktop.
Quick helper for making Helm Code of Conduct PRs
#! /bin/bash
PROJECT=$1
ORG=${2:-helm}
BRANCH=${3:-helm-coc}
SOURCE=${4:-~/development/Go/src/github.com/helm/chart-testing/code-of-conduct.md}
FORK=$(whoami)
FILE=code-of-conduct.md
GIT_MESSAGE_HEAD="Helm code of conduct"
GIT_MESSAGE_BODY="See https://github.com/helm/chart-testing/issues/48"
HUB_MESSAGE="[PENDING] Helm code of conduct\n\nPending Helm project consensus.\n\nSee helm/chart-testing#48"
####
TMP=$(mktemp -d)
git clone [email protected]:${ORG}/${PROJECT}.git ${TMP}/${PROJECT}
cd ${TMP}/${PROJECT}
pwd
hub fork
git checkout -b ${BRANCH}
cat ${SOURCE} > ${TMP}/${PROJECT}/${FILE}
git add ${FILE}
git diff --staged
git commit --signoff -m "$GIT_MESSAGE_HEAD" -m "$GIT_MESSAGE_BODY"
git push $FORK $BRANCH
echo -e "$HUB_MESSAGE" | hub pull-request -o -F -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment