2 parents d769c53 + d51b37a commit dd89dc6Copy full SHA for dd89dc6
1 file changed
common.sh
@@ -13,7 +13,12 @@ fi
13
# by grep on github.com/ we would skip ssh ones
14
if git fetch -v 2>&1 | grep -q github.com/; then
15
if ! git remote | grep -q "$ghremote" ; then
16
- 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
17
+ # disable actions in the fork -- we just want to provide contributions upstream
18
+ fork_repo=$(git remote get-url "$ghremote" | sed -e 's|.*github.com[:/]||' -e 's|\.git$||')
19
+ GH_TOKEN="$GITHUB_TOKEN" gh api -X PUT "repos/$fork_repo/actions/permissions" -F enabled=false || \
20
+ echo "WARNING: Failed to disable actions on fork $fork_repo" >&2
21
+ else
22
echo "errored out, sleeping, trying to fetch"
23
sleep 2
24
git fetch "$ghremote"
0 commit comments