Skip to content

Commit 371c9cc

Browse files
committed
Rely on gh being authenticated (found uncommitted)
Conflicts: common.sh - removed GH_TOKEN also from another call
1 parent dd89dc6 commit 371c9cc

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

common.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ branch=$(git rev-parse --abbrev-ref HEAD)
55
ghuser=$(git config github.user)
66
ghremote=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
1416
if 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"

shellcheckit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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
---
4344
name: Shellcheck

0 commit comments

Comments
 (0)