-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent git from prompting for credentials
There can be situations where git needs credentials and prompts the user, * Trying to push to via http * Trying to push via ssh but without having a key, or a key with a passphrase * Trying to fetch from a private repo via http or ssh This does not make sense in automated code and results in a hanging process waitign for input. We can prevent a prompt by setting the following two variables: https://git-scm.com/docs/git#Documentation/git.txt-codeGITASKPASScode GIT_ASKPASS If this environment variable is set, then Git commands which need to acquire passwords or passphrases (e.g. for HTTP or IMAP authentication) will call this program with a suitable prompt as command-line argument and read the password from its STDOUT. See also the core.askPass option in git-config[1]. https://git-scm.com/docs/git#Documentation/git.txt-codeGITTERMINALPROMPTcode GIT_TERMINAL_PROMPT If this Boolean environment variable is set to false, git will not prompt on the terminal (e.g., when asking for HTTP authentication). This way we will immediately get an error message. Issue: https://progress.opensuse.org/issues/174592 In this case the error presented to the user is: "Unable to push Git commit (/path/to/needles): remote: Support for password authentication was removed on August 13, 2021. remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication. fatal: Authentication failed for 'https://github.com/perlpunk/os-autoinst-needles-openQA/'" That can be improved in a followup by adding a link to our documentation.
- Loading branch information
Showing
3 changed files
with
15 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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