Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Last active October 12, 2021 15:11
Show Gist options
  • Save KyMidd/570eb6dda47a86eda9924ef59489e0c7 to your computer and use it in GitHub Desktop.
Save KyMidd/570eb6dda47a86eda9924ef59489e0c7 to your computer and use it in GitHub Desktop.
# Create workflows directory if not exist, copy source over existing
mkdir -p .github/workflows
cp ../../actions-runner/_work/$automation_repo/$automation_repo/commit_checker/github_commit_checker.yml.template .github/workflows/_GitCommitChecker.yml
# Checkout new branch
git checkout -b $branch
# Add file, commit
git add .
git commit -m $commit_message
# Identify base/main branch
if [[ "$initRepo" == "true" ]]; then
base_branch=master
else
base_branch=$(git symbolic-ref refs/remotes/origin/HEAD | cut -d "/" -f 4)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment