From 3bff6c4a4a2d7979a4af5283e1483d124ae78ba7 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 10 Jul 2025 10:01:18 +0200 Subject: [PATCH] Download GitHub database: fix `gh` invocation on Windows When running `gh api /repos/...` in the Git Bash on Windows, it leads to a 404. The reason is the automatic path conversion from "Unix-y" paths on the command-line to proper Windows paths, as described in detail https://www.msys2.org/docs/filesystem-paths/. Git Bash simply has no chance to understnad that `/repos/...` is not referring to an absolute path on the local filesystem. Let's just skip the leading slash. This is as valid an invocation, and sidesteps that path conversion on Windows. Signed-off-by: Johannes Schindelin --- docs/codeql/reusables/download-github-database.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/codeql/reusables/download-github-database.rst b/docs/codeql/reusables/download-github-database.rst index e416d3cd8ecf..e2b2303c2fa8 100644 --- a/docs/codeql/reusables/download-github-database.rst +++ b/docs/codeql/reusables/download-github-database.rst @@ -3,12 +3,12 @@ GitHub stores CodeQL databases for over 200,000 repos on GitHub.com, which you c You can check if a repository has any CodeQL databases available for download using the ``/repos///code-scanning/codeql/databases`` endpoint. For example, to check for CodeQL databases using the `GitHub CLI `__ you would run:: - gh api /repos///code-scanning/codeql/databases + gh api repos///code-scanning/codeql/databases This command returns information about any CodeQL databases that are available for a repository, including the language the database represents, and when the database was last updated. If no CodeQL databases are available, the response is empty. When you have confirmed that a CodeQL database exists for the language you are interested in, you can download it using the following command:: - gh api /repos///code-scanning/codeql/databases/ -H 'Accept: application/zip' > path/to/local/database.zip + gh api repos///code-scanning/codeql/databases/ -H 'Accept: application/zip' > path/to/local/database.zip For more information, see the documentation for the `Get CodeQL database `__ endpoint in the GitHub REST API documentation.