-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
factored out code to reshare with shellcheckit
- Loading branch information
1 parent
3bf848e
commit 4410bee
Showing
2 changed files
with
19 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
branch=$(git rev-parse --abbrev-ref HEAD) | ||
ghuser=$(git config github.user) | ||
ghremote=gh-${ghuser:-mine} | ||
|
||
if [ -z "${GITHUB_TOKEN:-}" ]; then | ||
# if not available -- load from config possibly | ||
GITHUB_TOKEN=$(git config hub.oauthtoken) | ||
fi | ||
|
||
if ! git remote | grep "$ghremote"; then | ||
if ! GH_TOKEN="$GITHUB_TOKEN" gh repo fork --remote --remote-name "$ghremote"; then | ||
echo "errored out, sleeping, trying to fetch" | ||
sleep 2 | ||
git fetch "$ghremote" | ||
fi | ||
fi | ||
mkdir -p .github/workflows | ||
|