Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ fi
# by grep on github.com/ we would skip ssh ones
if git fetch -v 2>&1 | grep -q github.com/; then
if ! git remote | grep -q "$ghremote" ; then
if ! GH_TOKEN="$GITHUB_TOKEN" gh repo fork --remote --remote-name "$ghremote"; then
if GH_TOKEN="$GITHUB_TOKEN" gh repo fork --remote --remote-name "$ghremote"; then
# disable actions in the fork -- we just want to provide contributions upstream
fork_repo=$(git remote get-url "$ghremote" | sed -e 's|.*github.com[:/]||' -e 's|\.git$||')
GH_TOKEN="$GITHUB_TOKEN" gh api -X PUT "repos/$fork_repo/actions/permissions" -F enabled=false || \
echo "WARNING: Failed to disable actions on fork $fork_repo" >&2
else
echo "errored out, sleeping, trying to fetch"
sleep 2
git fetch "$ghremote"
Expand Down