Skip to content

Add token type detection and --prefer-fine-grained-token flag#588

Open
gm3dmo wants to merge 2 commits into
mainfrom
gm3dmo/prefer-fine-grained-token
Open

Add token type detection and --prefer-fine-grained-token flag#588
gm3dmo wants to merge 2 commits into
mainfrom
gm3dmo/prefer-fine-grained-token

Conversation

@gm3dmo

@gm3dmo gm3dmo commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds is_fine_grained_token and is_classic_pat helpers to thepower.py.
  • configure.py now detects the supplied token type and logs it.
  • Warns when a classic PAT is supplied while --prefer-fine-grained-token is enabled.
  • Adds the --prefer-fine-grained-token CLI flag (default: true) and writes PREFER_FINE_GRAINED_TOKEN to the generated .gh-api-examples.conf.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Detect fine-grained vs classic PATs in configure.py, warn when a classic
PAT is supplied while fine-grained tokens are preferred, and add the
PREFER_FINE_GRAINED_TOKEN setting to the generated config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Change the flag from a boolean to a mode string:
- enforced: exit 1 when a classic PAT is supplied
- true/warn: warn only (default: warn)
- false: no check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant