From 2132c54abce72a54f19f81e3b1bfce57aafb3b3c Mon Sep 17 00:00:00 2001 From: morgankrey Date: Wed, 18 Feb 2026 20:58:25 -0600 Subject: [PATCH] Fix gh auth conflict when GH_TOKEN is already set (#49556) Fixes the workflow failure where `gh auth login --with-token` fails because `GH_TOKEN` is already set in the environment. The error was: ``` The value of the GH_TOKEN environment variable is being used for authentication. To have GitHub CLI store credentials instead, first clear the value from the environment. ``` The fix uses a subshell to unset `GH_TOKEN` before calling `gh auth login`: ```bash echo "$GH_TOKEN" | (unset GH_TOKEN && gh auth login --with-token) ``` Release Notes: - N/A --- .github/workflows/docs_suggestions.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs_suggestions.yml b/.github/workflows/docs_suggestions.yml index be1229e5fec12cc5c7ac0b03a5390eac3dc692d0..df4807bd9441c6b48f5628d5b06ed6cdf8591f17 100644 --- a/.github/workflows/docs_suggestions.yml +++ b/.github/workflows/docs_suggestions.yml @@ -95,7 +95,8 @@ jobs: id: analyze run: | # Ensure gh CLI is authenticated (GH_TOKEN may not be auto-detected) - echo "$GH_TOKEN" | gh auth login --with-token + # Unset GH_TOKEN first to allow gh auth login to store credentials + echo "$GH_TOKEN" | (unset GH_TOKEN && gh auth login --with-token) OUTPUT_FILE=$(mktemp) @@ -268,7 +269,8 @@ jobs: id: analyze run: | # Ensure gh CLI is authenticated (GH_TOKEN may not be auto-detected) - echo "$GH_TOKEN" | gh auth login --with-token + # Unset GH_TOKEN first to allow gh auth login to store credentials + echo "$GH_TOKEN" | (unset GH_TOKEN && gh auth login --with-token) OUTPUT_FILE=$(mktemp)