File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,20 @@ branch=$(git rev-parse --abbrev-ref HEAD)
55ghuser=$( git config github.user)
66ghremote=gh-${ghuser:- mine}
77
8- if [ -z " ${GITHUB_TOKEN:- } " ]; then
9- # if not available -- load from config possibly
10- GITHUB_TOKEN=$( git config hub.oauthtoken)
11- fi
8+
9+ # Just rely on gh being authenticated
10+ # if [ -z "${GITHUB_TOKEN:-}" ]; then
11+ # # if not available -- load from config possibly
12+ # GITHUB_TOKEN=$(git config hub.oauthtoken)
13+ # fi
1214
1315# by grep on github.com/ we would skip ssh ones
1416if git fetch -v 2>&1 | grep -q github.com/; then
1517 if ! git remote | grep -q " $ghremote " ; then
16- if GH_TOKEN= " $GITHUB_TOKEN " gh repo fork --remote --remote-name " $ghremote " ; then
18+ if gh repo fork --remote --remote-name " $ghremote " ; then
1719 # disable actions in the fork -- we just want to provide contributions upstream
1820 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 || \
21+ gh api -X PUT " repos/$fork_repo /actions/permissions" -F enabled=false || \
2022 echo " WARNING: Failed to disable actions on fork $fork_repo " >&2
2123 else
2224 echo " errored out, sleeping, trying to fetch"
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ function generate_workflow() {
3838 branch=" $branch_ "
3939 fi
4040 fi
41+ mkdir -p " $( dirname " $WORKFLOW " ) "
4142 cat > " $WORKFLOW " << EOF
4243---
4344name: Shellcheck
You can’t perform that action at this time.
0 commit comments