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

@@ -1,4 +1,6 @@
# GitHub MCP Server Configuration # GitHub Finance Devcontainer Configuration
# Generate a Personal Access Token here https://github.com/settings/tokens
# requires 'repo', 'read:org', 'admin:public_key'
GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
# PostgreSQL Configuration # PostgreSQL Configuration

View File

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