Prek: Prefer gh auth over GitHub token env#66692
Merged
Merged
Conversation
potiuk
approved these changes
May 11, 2026
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Contributor
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
potiuk
added a commit
that referenced
this pull request
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GH_TOKEN/GITHUB_TOKENno longer shadow a validgh auth logincredential when prek helpers resolve a GitHub token.This applies the same GitHub auth precedence used by Breeze to local prek scripts: explicit token arguments still win, then helpers try
gh auth tokenwith token env vars removed, then they fall back to ambient token env vars for CI/token-only environments.Updated paths:
upgrade_important_versions.pyviaretrieve_gh_token(...)download_k8s_schemas.pyvia optional token resolution, preserving unauthenticated fallbackTests cover explicit-token precedence, cleaned
gh auth tokenprecedence, env fallback, missinggh, blankgh auth tokenoutput, and the existing fatal help path when a required token cannot be resolved.I kept these as small
scripts/ci/prekhelpers instead of importing the Breeze helper because the two paths run in different package/runtime contexts.Breeze owns
airflow_breeze.utils.github, while these are Airflow-owned local prek scripts that can run as standalone hook/script entries. Making prek helpers importairflow_breezewould couple local hook execution to Breeze being importable in that environment. The logic is intentionally duplicated here, but kept minimal: token resolution only, not the broader Breezeghcommand wrapper.Breeze PR: #66255
Related: #55567
Was generative AI tooling used to co-author this PR?
Generated-by: GPT-5.5 following the guidelines