Skip to content

Commit

Permalink
Merge pull request #202 from datalad/gh-token
Browse files Browse the repository at this point in the history
run-tests.sh: Get GitHub token from `gh` if envvar not set
  • Loading branch information
yarikoptic authored May 20, 2024
2 parents 97928c4 + 6ab391d commit dd73d86
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#!/bin/bash
set -e

# Support using the GitHub token registered with `gh` for testing so that the
# user doesn't have to store their token in ~/.gitconfig
if [ "$GITHUB_TOKEN" = "" ] && command -V gh 2>/dev/null
then
GITHUB_TOKEN="$(gh auth token)"
if [ $? = 0 ]
then export GITHUB_TOKEN
fi
fi

case "$(uname)" in
Darwin)
# The lengthy default $TMPDIR on macOS causes lengthy shebangs when
Expand Down

0 comments on commit dd73d86

Please sign in to comment.