Update GitHub PAT configuration and improve script exit handling

This commit is contained in:
GitHub Copilot
2025-05-08 11:47:35 -04:00
parent 96c8bfe9de
commit 587fb7f3f8
2 changed files with 15 additions and 3 deletions

View File

@@ -53,8 +53,18 @@ fi
if [[ -n "${pat}" ]] && [[ "${#pat}" -gt 30 ]]; then
export GITHUB_PERSONAL_ACCESS_TOKEN="${pat}"
echo "GitHub Personal Access Token loaded successfully"
exit 0
# Use return instead of exit when script is sourced
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
return 0
else
exit 0
fi
else
echo >&2 "ERROR: Could not find valid GitHub Personal Access Token"
exit 1
# Use return instead of exit when script is sourced
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
return 1
else
exit 1
fi
fi