prompt-pgp-passphrase.py
prompt-pgp-passphrase.py makes a dummy PGP call to prompt for the user's passphrase early in the execution. This ensures the user is prompted at the beginning rather than waiting until signing is needed near the end of a process.
What It Does
The script:
- Creates a temporary dummy file
- Attempts to sign it with GPG (which prompts for passphrase)
- Cleans up the temporary files
- Returns success even if GPG is not available (to avoid breaking workflows)
Usage
python3 scripts/prompt-pgp-passphrase.py
When to Use
This script is typically called by other scripts (like push.py and release.py) at the beginning of their execution to:
- Prompt for PGP passphrase early
- Avoid delays later when signing is actually needed
- Provide a better user experience
Exit Codes
- Always returns
0(success) to avoid breaking workflows - Prints warnings if GPG is not available or if the prompt times out
Requirements
- Python 3.6 or higher
- GPG (optional, script handles gracefully if not available)
- No external Python dependencies (uses only standard library)
Notes
- The script is designed to fail gracefully
- If GPG is not found, it prints a warning and continues
- If the prompt times out, it's treated as okay (user may not need signing)
- The dummy file and signature are automatically cleaned up
Share feedback or follow-up questions for this page directly through GitHub.