mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Merge branch 'main' into rc/3.7
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
.. _about-codeql-workspaces:
|
||||
|
||||
About CodeQL Workspaces
|
||||
About CodeQL workspaces
|
||||
=======================
|
||||
|
||||
.. include:: ../reusables/beta-note-package-management.rst
|
||||
@@ -20,7 +20,7 @@ A CodeQL workspace is defined by a ``codeql-workspace.yml`` yaml file. This file
|
||||
* The ``ignore`` block contains a list of glob patterns that define CodeQL packs that are not available in the workspace.
|
||||
* The ``registries`` block contains a list of GHES URLs and package patterns that control which container registry is used for publishing CodeQL packs. For more information, see :ref:`Working with CodeQL packs on GitHub Enterprise Server <working-with-codeql-packs-on-ghes>`.
|
||||
|
||||
Each entry in the ``provide`` or ``ignore`` section must map to the location of a ``qlpack.yml`` file. All glob patterns are defined relative to the directory that contains the workspace file. For a list of patterns accepted in this file, see" `@actions/glob <https://github.com/actions/toolkit/tree/main/packages/glob#patterns>`__ .
|
||||
Each entry in the ``provide`` or ``ignore`` section must map to the location of a ``qlpack.yml`` file. All glob patterns are defined relative to the directory that contains the workspace file. For a list of patterns accepted in this file, see "`@actions/glob <https://github.com/actions/toolkit/tree/main/packages/glob#patterns>`__ ."
|
||||
|
||||
For example, the following ``codeql-workspace.yml`` file defines a workspace that contains all the CodeQL packs recursively found in the ``codeql-packs`` directory, except for the packs in the ``experimental`` directory. The ``registries`` block specifies that ``codeql/*`` packs should be downloaded from https://ghcr.io/v2/, which is GitHub's default container registry. All other packs should be downloaded from and published to the regsitry at ``GHE_HOSTNAME``.
|
||||
|
||||
@@ -55,7 +55,7 @@ This is particularly useful in the following situations:
|
||||
CodeQL workspaces and query resolution
|
||||
--------------------------------------
|
||||
|
||||
All CodeQL packs in a workspace are available as source dependencies for each other when you run any CodeQL command that resolves queries or packs. For example, when you run ``codeql pack install`` in a pack directory in a workspace, any dependency that can be found in the workspace will be used instead of downloading that dependency to the package cache and adding it to the ``codeql-pack.lock.yml`` file. For more information, see ":ref:Adding and Installing Dependencies <adding-and-installing-dependencies>`."
|
||||
All CodeQL packs in a workspace are available as source dependencies for each other when you run any CodeQL command that resolves queries or packs. For example, when you run ``codeql pack install`` in a pack directory in a workspace, any dependency that can be found in the workspace will be used instead of downloading that dependency to the package cache and adding it to the ``codeql-pack.lock.yml`` file. For more information, see ":ref:`Adding and Installing Dependencies <adding-and-installing-dependencies>`."
|
||||
|
||||
Similarly, when you publish a CodeQL query pack to the GitHub container registry using ``codeql pack publish`` the command will always use the dependencies from the workspace instead of using dependencies found in the local package cache.
|
||||
|
||||
|
||||
12
docs/codeql/codeql-cli/about-ql-packs.rst
Normal file
12
docs/codeql/codeql-cli/about-ql-packs.rst
Normal file
@@ -0,0 +1,12 @@
|
||||
.. _about-ql-packs:
|
||||
|
||||
About QL packs
|
||||
==============
|
||||
|
||||
This page has been moved to ":doc:`About CodeQL packs <about-codeql-packs>`."
|
||||
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
about-ql-packs
|
||||
@@ -11,11 +11,11 @@ or download them from GitHub.com.
|
||||
CodeQL analysis relies on extracting relational data from your code, and
|
||||
using it to build a :ref:`CodeQL database <codeql-database>`. CodeQL
|
||||
databases contain all of the important information about a codebase, which can
|
||||
be analyzed by executing CodeQL queries against it. GitHub creates and
|
||||
be analyzed by executing CodeQL queries against it. GitHub creates and
|
||||
stores CodeQL databases for a large number of open-source projects. For more information,
|
||||
see ":ref:`Downloading CodeQL databases from GitHub.com <downloading-codeql-databases-from-github-com>`."
|
||||
|
||||
You can also create CodeQL databases yourself using the CodeQL CLI.
|
||||
You can also create CodeQL databases yourself using the CodeQL CLI.
|
||||
Before you generate a CodeQL database, you need to:
|
||||
|
||||
- Install and set up the CodeQL CLI. For more information, see
|
||||
@@ -214,10 +214,10 @@ commands that you can specify for compiled languages.
|
||||
|
||||
codeql database create cpp-database --language=cpp --command=make
|
||||
|
||||
- C# project built using ``dotnet build``::
|
||||
- C# project built using ``dotnet build``:
|
||||
|
||||
It is a good idea to add `/t:rebuild` to ensure that all code will be built, or do a
|
||||
prior `dotnet clean` (code that is not built will not be included in the CodeQL database):
|
||||
It is a good idea to add `/t:rebuild` to ensure that all code will be built, or do a
|
||||
prior `dotnet clean` (code that is not built will not be included in the CodeQL database)::
|
||||
|
||||
codeql database create csharp-database --language=csharp --command='dotnet build /t:rebuild'
|
||||
|
||||
@@ -391,9 +391,9 @@ Downloading databases from GitHub.com
|
||||
-------------------------------------
|
||||
|
||||
.. include:: ../reusables/download-github-database.rst
|
||||
|
||||
|
||||
Before running an analysis with the CodeQL CLI, you must unzip the databases.
|
||||
|
||||
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user