Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created February 19, 2023 18:06
Show Gist options
  • Save KyMidd/80bd9fbb27e2d11ce61fd836768a490e to your computer and use it in GitHub Desktop.
Save KyMidd/80bd9fbb27e2d11ce61fd836768a490e to your computer and use it in GitHub Desktop.
# If we've made any changes, create branch, add files, push
if [ $MADE_CHANGE = true ]; then
# Checkout local branch
git checkout -b feature/${COLLECTION_MIGRATION_TICKET}-Create-GitHubActions-and-CODEOWNERS
# Add files to git
git add .github/workflows/_PfGitCommitChecker.yml &>/dev/null
git add .github/workflows/ActionPRValidate_AnyJobRun.yaml &>/dev/null
git add .github/workflows/MergeCommitNotify.yml &>/dev/null
git add CODEOWNERS &>/dev/null
# Commit changes
COMMIT=$(git commit -m "${COLLECTION_MIGRATION_TICKET} Create GitHub Actions and CODEOWNERS")
if [[ $(echo "$COMMIT" | grep 'nothing to commit' | wc -l | awk 'NF') -eq 1 ]] ; then
echo "No changes, nothing to commit"
else
# Changes detected, print commit info and do PR
echo "$COMMIT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment