fix: add --headless to prevent browser opening on auth failure in CI#49
Closed
k4leung4 wants to merge 1 commit into
Closed
fix: add --headless to prevent browser opening on auth failure in CI#49k4leung4 wants to merge 1 commit into
k4leung4 wants to merge 1 commit into
Conversation
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
cpanato
approved these changes
Mar 17, 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.
Summary
Add
--headlessflag tochainctl auth loginandchainctl auth configure-dockercommands in the action. This preventschainctl from attempting to open a browser window when authentication
fails in CI, which hangs the workflow indefinitely.
Problem
When
setup-chainctlfails (e.g., identity name passed instead of UIDP,misconfigured identity, missing
id-token: writepermission),chainctlfalls back to browser-based authentication. In GitHub Actions, there is
no browser, so the workflow hangs until it times out.
Fix
--headlessensures chainctl uses the device flow fallback instead ofbrowser-based auth. This only affects the failure path — when
--identitysucceeds via ambient credentials (the normal CI path),
--headlessisnever exercised.
Risk
None. The
--headlessflag only changes behavior when ambient credentialdetection fails, which is already a failure case. Normal
--identityauthentication via GitHub Actions OIDC is unaffected.
🤖 Generated with Claude Code