You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/codeql-cli/about-codeql-workspaces.rst
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,15 @@ In most cases, you should store the CodeQL workspace and the CodeQL packs contai
14
14
The ``codeql-workspace.yml`` file
15
15
---------------------------------
16
16
17
-
A CodeQL workspace is defined by a ``codeql-workspace.yml`` yaml file. This file contains a ``provide`` block, and optionally an ``ignore`` block.
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.
18
18
19
19
* The ``provide`` block contains a list of glob patterns that define the CodeQL packs that are available in the workspace.
20
20
* The ``ignore`` block contains a list of glob patterns that define CodeQL packs that are not available in the workspace.
21
+
* 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>`.
21
22
22
23
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>`__ .
23
24
24
-
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``.
25
26
26
27
.. code-block:: yaml
27
28
@@ -30,6 +31,13 @@ For example, the following ``codeql-workspace.yml`` file defines a workspace tha
30
31
ignore:
31
32
- "*/codeql-packs/**/experimental/**/qlpack.yml"
32
33
34
+
registries:
35
+
- packages: 'codeql/*'
36
+
url: https://ghcr.io/v2/
37
+
38
+
- packages: '*'
39
+
url: https://containers.GHE_HOSTNAME/v2/
40
+
33
41
To verify that your ``codeql-workspace.yml`` file includes the CodeQL packs that you expect, run the ``codeql pack ls`` command in the same directory as your workspace. The result of the command is a list of all CodeQL packs in the workspace.
@@ -91,13 +93,17 @@ For example, the following ``qlconfig.yml`` file associates all packs with the C
91
93
.. code-block:: yaml
92
94
93
95
registries:
94
-
- packages: 'codeql/*'
96
+
- packages:
97
+
- 'codeql/*'
98
+
- 'other-org/*'
95
99
url: https://ghcr.io/v2/
96
100
- packages: '*'
97
101
url: https://containers.GHE_HOSTNAME/v2/
98
102
99
103
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.
100
-
This means that you'll generally want to define the most specific package name patterns first.
104
+
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.
105
+
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>`.
101
107
102
108
You can now use ``codeql pack publish``, ``codeql pack download``, and ``codeql database analyze`` to manage packs on GitHub Enterprise Server.
0 commit comments