diff --git a/.devcontainer/init.sh b/.devcontainer/init.sh index 2a60f6338df..cfaf2af3500 100644 --- a/.devcontainer/init.sh +++ b/.devcontainer/init.sh @@ -4,11 +4,13 @@ source .venv/bin/activate # Logout default account export GITHUB_TOKEN= -# Check `repo` scope exists or not -if gh auth status -a 2>/dev/null | grep "Token scopes: " | grep -q "repo"; then - echo "You now have access to GitHub." -else - gh auth login -p https -w +if [[ $- == *i* ]]; then # Interactive shell only + # Check `repo` scope exists or not + if gh auth status -a 2>/dev/null | grep "Token scopes: " | grep -q "repo"; then + echo "You now have access to GitHub." + else + gh auth login -p https -w + fi fi # Check `aaz-dev` is available or not