From abdc79b009274e9e9215b25e6226fd1c410d59a3 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Fri, 9 Sep 2022 08:27:55 -0700 Subject: [PATCH] Update the example `codeql-workspace.yml` Add a better example for `registries`. --- docs/codeql/codeql-cli/about-codeql-workspaces.rst | 7 +++++-- .../codeql-cli/publishing-and-using-codeql-packs.rst | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/codeql/codeql-cli/about-codeql-workspaces.rst b/docs/codeql/codeql-cli/about-codeql-workspaces.rst index bab102d7ff6..f5b477ec2c0 100644 --- a/docs/codeql/codeql-cli/about-codeql-workspaces.rst +++ b/docs/codeql/codeql-cli/about-codeql-workspaces.rst @@ -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 `__ . -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/ diff --git a/docs/codeql/codeql-cli/publishing-and-using-codeql-packs.rst b/docs/codeql/codeql-cli/publishing-and-using-codeql-packs.rst index 88d57059ea4..a91bc570768 100644 --- a/docs/codeql/codeql-cli/publishing-and-using-codeql-packs.rst +++ b/docs/codeql/codeql-cli/publishing-and-using-codeql-packs.rst @@ -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 `. +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 `. You can now use ``codeql pack publish``, ``codeql pack download``, and ``codeql database analyze`` to manage packs on GitHub Enterprise Server.