Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When --with-token is present, gh auth login should not prompt for authentication method #4972

Closed
ghost opened this issue Dec 30, 2021 · 2 comments
Labels
bug Something isn't working needs-triage needs to be reviewed

Comments

@ghost
Copy link

ghost commented Dec 30, 2021

Describe the bug

When the command > gh auth login --with-token < token.txt is issued, it prompts for the authentication type. Clearly, if "--with-token" is present, the desire is to use the provided token value.

Steps to reproduce the behavior

  1. Type this '.gh auth login --with-token < token.txt'
  2. View the prompt for authentication type even tho it is supplied via the '--with-token' flag.

Expected vs actual behavior

When the authentication type is supplied, no prompt should be generated.

Logs

=> ERROR [ 7/12] RUN gh auth login --with-token < .githubtoken --scopes repo,read:org                                    0.2s
------
> [ 7/12] RUN gh auth login --with-token < .githubtoken --scopes repo,read:org:
? How would you like to authenticate GitHub CLI?  [Use arrows to move, type to filter]
#10 0.201 > Login with a web browser
#10 0.201   Paste an authentication token
#10 0.201 could not prompt: EOF
------
executor failed running [/bin/sh -c gh auth login --with-token < .githubtoken --scopes repo,read:org]: exit code: 1

@ghost ghost added the bug Something isn't working label Dec 30, 2021
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Dec 30, 2021
@samcoe
Copy link
Contributor

samcoe commented Jan 5, 2022

@davewolfusa Agreed that we shouldn't prompt in this case, seems like #4506 covers this as well so I am going to close this in favor of that issue 🙏

@samcoe samcoe closed this as completed Jan 5, 2022
@ghost
Copy link
Author

ghost commented Jan 5, 2022

That's fine. I think the difference is that this is a bug vs. an enhancement. For a dockerfile, I really need gh to provide a non-interactive authentication method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

2 participants