mirror of
https://github.com/github/codeql.git
synced 2026-02-01 07:42:57 +01:00
Update the example codeql-workspace.yml
Add a better example for `registries`.
This commit is contained in:
@@ -14,7 +14,7 @@ In most cases, you should store the CodeQL workspace and the CodeQL packs contai
|
||||
The ``codeql-workspace.yml`` file
|
||||
---------------------------------
|
||||
|
||||
A CodeQL workspace is defined by a ``codeql-workspace.yml`` yaml file. This file contains a ``provide`` block, and optionally ``ignore``, and ``registries`` blocks.
|
||||
A CodeQL workspace is defined by a ``codeql-workspace.yml`` yaml file. This file contains a ``provide`` block, and optionally ``ignore`` and ``registries`` blocks.
|
||||
|
||||
* The ``provide`` block contains a list of glob patterns that define the CodeQL packs that are available in the workspace.
|
||||
* The ``ignore`` block contains a list of glob patterns that define CodeQL packs that are not available in the workspace.
|
||||
@@ -22,7 +22,7 @@ A CodeQL workspace is defined by a ``codeql-workspace.yml`` yaml file. This file
|
||||
|
||||
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:
|
||||
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``.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@@ -32,6 +32,9 @@ For example, the following ``codeql-workspace.yml`` file defines a workspace tha
|
||||
- "*/codeql-packs/**/experimental/**/qlpack.yml"
|
||||
|
||||
registries:
|
||||
- packages: 'codeql/*'
|
||||
url: https://ghcr.io/v2/
|
||||
|
||||
- packages: '*'
|
||||
url: https://containers.GHE_HOSTNAME/v2/
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ For example, the following ``qlconfig.yml`` file associates all packs with the C
|
||||
The CodeQL CLI will determine which registry to use for a given package name by finding the first item in the ``registries`` list with a ``packages`` property that matches that package name.
|
||||
This means that you'll generally want to define the most specific package name patterns first. The ``packages`` property may be a single package name, a glob pattern, or a YAML list of package names and glob patterns.
|
||||
|
||||
The ``registries`` list can also be placed inside of a ``codeql-workspace.yml`` file. Doing so will allow you to fix the registries list for a specific workspace, so that it can be shared amongst other CodeQL users of the workspace. The ``registries`` list in the ``codeql-workspace.yml`` will be merged with and take precedence over the list in the global ``qlconfig.yml``. For more information about ``codeql-workspace.yml``, see :ref:`About CodeQL workspaces <about-codeql-workspaces>`.
|
||||
The ``registries`` list can also be placed inside of a ``codeql-workspace.yml`` file. Doing so will allow you to define the registries to be used within a specific workspace, so that it can be shared amongst other CodeQL users of the workspace. The ``registries`` list in the ``codeql-workspace.yml`` will be merged with and take precedence over the list in the global ``qlconfig.yml``. For more information about ``codeql-workspace.yml``, see :ref:`About CodeQL workspaces <about-codeql-workspaces>`.
|
||||
|
||||
You can now use ``codeql pack publish``, ``codeql pack download``, and ``codeql database analyze`` to manage packs on GitHub Enterprise Server.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user