leeyspaul opened a new pull request, #66692:
URL: https://github.com/apache/airflow/pull/66692

   <!-- SPDX-License-Identifier: Apache-2.0
        https://www.apache.org/licenses/LICENSE-2.0 -->
   
   `GH_TOKEN` / `GITHUB_TOKEN` no longer shadow a valid `gh auth login` 
credential 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 token` 
with token env vars removed, then they fall back to ambient token env vars for 
CI/token-only environments.
   
   Updated paths:
   - `upgrade_important_versions.py` via `retrieve_gh_token(...)`
   - `download_k8s_schemas.py` via optional token resolution, preserving 
unauthenticated fallback
   
   Tests cover explicit-token precedence, cleaned `gh auth token` precedence, 
env fallback, missing `gh`, blank `gh auth token` output, and the existing 
fatal help path when a required token cannot be resolved.
   
   I kept these as small `scripts/ci/prek` helpers 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 import`airflow_breeze` would 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 Breeze `gh` 
command wrapper.
   
   Related: https://github.com/apache/airflow/issues/55567
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes - GPT-5.5
   
   Generated-by: GPT-5.5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to