-
-
Save KyMidd/9d82e10605e1cbd014b65cdf9ab78f06 to your computer and use it in GitHub Desktop.
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
| # Grab all repo clone values | |
| getRepoCloneValues=$(cat project_repos_raw | jq --raw-output --arg repo "$repo" ' | |
| .values[] | |
| | select( .name | contains($repo)).links.clone[] | |
| | select( .name | contains("ssh")) | .href') | |
| # Select first repo clone value if there are multiple | |
| IFS=';' read -r stashRepoUrl string <<< "$getRepoCloneValues" | |
| # Clone old repo | |
| git clone --mirror $stashRepoUrl $repo | |
| # Change context into folder | |
| cd $repo | |
| # Attempt push trap results | |
| echo "Attempting git push --mirror without any modifications" | |
| gitPushResults= | |
| gitPushResults=$(git push --mirror https://oauth2:$GITHUB_TOKEN@github.com/$github_project_name/$github_repo_name.git --porcelain 2>&1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment