Skip to content

Commit 361dba1

Browse files
committed
Add information about the registries block in codeql-workspace.yml
1 parent ed66388 commit 361dba1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ 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 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.
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.
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>`.
2122

2223
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>`__ .
2324

@@ -30,6 +31,10 @@ For example, the following ``codeql-workspace.yml`` file defines a workspace tha
3031
ignore:
3132
- "*/codeql-packs/**/experimental/**/qlpack.yml"
3233
34+
registries:
35+
- packages: '*'
36+
url: https://containers.GHE_HOSTNAME/v2/
37+
3338
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.
3439

3540
.. _source-dependencies:

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ The ``analyze`` command will run the default suite of any specified CodeQL packs
7474

7575
codeql <database> analyze <scope>/<pack> <scope>/<other-pack>
7676

77+
.. _working-with-codeql-packs-on-ghes:
78+
7779
Working with CodeQL packs on GitHub Enterprise Server
7880
-----------------------------------------------------
7981

@@ -91,13 +93,17 @@ For example, the following ``qlconfig.yml`` file associates all packs with the C
9193
.. code-block:: yaml
9294
9395
registries:
94-
- packages: 'codeql/*'
96+
- packages:
97+
- 'codeql/*'
98+
- 'other-org/*'
9599
url: https://ghcr.io/v2/
96100
- packages: '*'
97101
url: https://containers.GHE_HOSTNAME/v2/
98102
99103
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 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>`.
101107

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

0 commit comments

Comments
 (0)