feat: update action.yml to use pwsh shell and enhance vm.py with start option; add credential management scripts
Lint / pssa (push) Failing after 7s
Lint / python (push) Failing after 1s

This commit is contained in:
2026-05-21 00:11:20 +02:00
parent b9d6994c85
commit 3921758392
8 changed files with 371 additions and 84 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/opt/ci/venv/bin/python
"""Store a CI credential in the file keyring for ci-runner (two-entry scheme).
Usage:
sudo -u ci-runner /opt/ci/venv/bin/python tools/ci-cred-set.py <target> [<username>]
Examples:
sudo -u ci-runner /opt/ci/venv/bin/python tools/ci-cred-set.py BuildVMGuest "WINBUILD-2025\\ci_build"
sudo -u ci-runner /opt/ci/venv/bin/python tools/ci-cred-set.py GiteaPAT ci-runner-linux
"""
import getpass
import sys
try:
import keyring
except ImportError:
sys.exit("keyring not installed")
target = sys.argv[1] if len(sys.argv) > 1 else "BuildVMGuest"
username = sys.argv[2] if len(sys.argv) > 2 else input(f"Username for {target}: ")
password = getpass.getpass(f"Password for {target}/{username}: ")
# Entry 1: password, keyed by (service=target, username=username)
keyring.set_password(target, username, password)
# Entry 2: username stored separately so get_credential(target, None) can find it
keyring.set_password(f"{target}:meta", "username", username)
print(f"Stored: service={target!r} username={username!r}")