Files
github--github-mcp-server/script/compare-scopes
copilot-swe-agent[bot] 309753a542 Add compare-scopes command with tests
- Created compare_scopes.go with compare-scopes command
- Fetches token scopes from GitHub API using pkg/scopes/fetcher
- Compares with required scopes from inventory
- Reports missing and extra scopes
- Supports text and json output formats
- Added comprehensive unit tests
- Created script/compare-scopes wrapper script

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
2026-01-08 09:16:25 +00:00

30 lines
839 B
Bash
Executable File

#!/bin/bash
#
# Compare PAT token scopes with required scopes for enabled tools.
#
# Usage:
# script/compare-scopes [--toolsets=...] [--token=...] [--output=text|json]
#
# The token can be provided via GITHUB_PERSONAL_ACCESS_TOKEN environment variable
# or via the --token flag.
#
# Examples:
# export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...
# script/compare-scopes
#
# script/compare-scopes --toolsets=all --output=json
# script/compare-scopes --token=ghp_... --toolsets=repos,issues
#
set -e
cd "$(dirname "$0")/.."
# Build the server if it doesn't exist or is outdated
if [ ! -f github-mcp-server ] || [ cmd/github-mcp-server/compare_scopes.go -nt github-mcp-server ]; then
echo "Building github-mcp-server..." >&2
go build -o github-mcp-server ./cmd/github-mcp-server
fi
exec ./github-mcp-server compare-scopes "$@"