Last active
May 1, 2020 06:13
-
-
Save karancode/17597b3212ab13805690c25f9f37c9a6 to your computer and use it in GitHub Desktop.
To create PRs in multiple repositories for similar code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| git_owner="karancode" | |
| git_repo=${1} | |
| if [ -d "${git_repo}" ]; then | |
| cd ${git_repo} | |
| git checkout . | |
| git checkout master | |
| else | |
| git clone https://github.com/${git_owner}/${git_repo}.git | |
| cd ${git_repo} | |
| fi | |
| git pull --all | |
| git rev-parse --verify githubaction | |
| exit_code=${?} | |
| if [ "${exit_code}" != "0" ]; then | |
| git checkout -b githubaction | |
| else | |
| git checkout githubaction | |
| fi | |
| mkdir -p .github/workflows | |
| cp /Users/karan.thanvi/Desktop/githubactions/base.yaml .github/workflows/ | |
| cp /Users/karan.thanvi/Desktop/githubactions/dev.yaml .github/workflows/ | |
| cp /Users/karan.thanvi/Desktop/githubactions/stg.yaml .github/workflows/ | |
| git add .github/workflows/ | |
| git commit -m "github action for dev/stg" | |
| git push --set-upstream origin githubaction | |
| hub pull-request --message "github action for base/dev/stg" -r ttamari,m3y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment