ci: [refactor] Move print_version step into ci-windows-cross.py helper
What changed, and why it matters
This commit is a routine cleanup of the project's automated Windows build testing. It moves a single step—printing the version of the compiled Bitcoin daemon—out of the GitHub Actions workflow file and into a small Python helper script. There is no change to the Bitcoin software users run, no security fix, and no vulnerability introduced.
No security action needed. Treat as normal CI maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff refactors CI for the Windows cross-compile job. A new Python helper .github/ci-windows-cross.py is added with a print_version subcommand that executes ./bin/bitcoind.exe -version via subprocess.run. The GitHub Actions workflow .github/workflows/ci.yml is updated to call this helper instead of invoking bitcoind.exe -version directly. The helper uses shlex.join for safe command echoing and sets check=True. The change is purely organizational and does not alter the command, its arguments, or the build outputs.
Changed components
.github/ci-windows-cross.py.github/workflows/ci.ymlInspect captured patch +41 / −1
diff --git a/.github/ci-windows-cross.py b/.github/ci-windows-cross.py
new file mode 100755
index 00000000..5382b5b6
--- /dev/null
+++ b/.github/ci-windows-cross.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+# Copyright (c) The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or https://opensource.org/license/mit/.
+
+import argparse
+import shlex
+import subprocess
+import sys
+from pathlib import Path
+
+
+def run(cmd, **kwargs):
+ print("+ " + shlex.join(cmd), flush=True)
+ kwargs.setdefault("check", True)
+ try:
+ return subprocess.run(cmd, **kwargs)
+ except Exception as e:
+ sys.exit(str(e))
+
+
+def print_version():
+ bitcoind = Path.cwd() / "bin" / "bitcoind.exe"
+ run([str(bitcoind), "-version"])
+
+
+def main():
+ parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
+ steps = [
+ "print_version",
+ ]
+ parser.add_argument("step", choices=steps, help="CI step to perform.")
+ args = parser.parse_args()
+
+ if args.step == "print_version":
+ print_version()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7f5299cf..c6ac3472 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -407,7 +407,7 @@ jobs:
name: ${{ matrix.artifact-name }}-${{ github.run_id }}
- name: Run bitcoind.exe
- run: ./bin/bitcoind.exe -version
+ run: py -3 .github/ci-windows-cross.py print_version
- *SET_UP_VS
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.