Skip to content

Commit abdc79b

Browse files
committed
Update the example codeql-workspace.yml
Add a better example for `registries`.
1 parent 361dba1 commit abdc79b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/codeql/codeql-cli/about-codeql-workspaces.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ In most cases, you should store the CodeQL workspace and the CodeQL packs contai
1414
The ``codeql-workspace.yml`` file
1515
---------------------------------
1616

17-
A CodeQL workspace is defined by a ``codeql-workspace.yml`` yaml file. This file contains a ``provide`` block, and optionally ``ignore``, and ``registries`` blocks.
17+
A CodeQL workspace is defined by a ``codeql-workspace.yml`` yaml file. This file contains a ``provide`` block, and optionally ``ignore`` and ``registries`` blocks.
1818

1919
* The ``provide`` block contains a list of glob patterns that define the CodeQL packs that are available in the workspace.
2020
* The ``ignore`` block contains a list of glob patterns that define CodeQL packs that are not available in the workspace.
2121
* 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>`.
2222

2323
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>`__ .
2424

25-
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:
25+
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``.
2626

2727
.. code-block:: yaml
2828
@@ -32,6 +32,9 @@ For example, the following ``codeql-workspace.yml`` file defines a workspace tha
3232
- "*/codeql-packs/**/experimental/**/qlpack.yml"
3333
3434
registries:
35+
- packages: 'codeql/*'
36+
url: https://ghcr.io/v2/
37+
3538
- packages: '*'
3639
url: https://containers.GHE_HOSTNAME/v2/
3740

docs/codeql/codeql-cli/publishing-and-using-codeql-packs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ For example, the following ``qlconfig.yml`` file associates all packs with the C
103103
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.
104104
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.
105105

106-
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>`.
106+
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>`.
107107

108108
You can now use ``codeql pack publish``, ``codeql pack download``, and ``codeql database analyze`` to manage packs on GitHub Enterprise Server.
109109

0 commit comments

Comments
 (0)