Manifest reference

This reference describes the configuration schema for ghwm.yml and the lockfile format for ghwm.lock.


ghwm.yml

The ghwm.yml file is located in the root of the consumer repository. It defines which managed workflows to install, where to fetch them from, and how to manage updates.

Top-level Keys

Key Type Required Default Description
source string No owner/ghwm-registry The default registry repository in owner/repository format.
workflows list Yes — The list of workflows to install.

Example

source: ghwfxlab/ghwm-registry

workflows:
  - name: linter
    version: "1.0.0"
  - name: auto-assign-pr
    version: "2.0.0"
    source: other-org/custom-registry
    update-triggers: true
    update-envs: true
    update-config-files: true

Workflow Entry Syntax

Entries under the workflows list can be specified in two formats:

Full YAML object allowing granular per-workflow configuration:

workflows:
  - name: linter
    version: "1.2.0"
    target: code-quality.yml
    update-triggers: false
    update-envs: false
    update-config-files: false

2. Compact String Syntax

A single string in name or name@version form:

workflows:
  - linter@1.2.0
  - release

Workflow Entry Fields

When using the mapping syntax, the following fields are supported:

Field Type Required Default Description
name string Yes — Identifier of the workflow package in the registry.
version string Conditional null Target package version (SemVer). Required for remote installs.
source string No Global source Repository in owner/repository format. Overrides the global source for this specific workflow.
target string No Packaged filename Custom target path under .github/workflows/.
update-triggers boolean No false When true, overwrites the existing workflow on: trigger section on update.
update-envs boolean No false When true, overwrites the existing workflow env: variables section on update.
update-config-files boolean No false When true, overwrites packaged non-workflow configuration files on update.

Field Details

name

The package identifier within the registry.

version

The exact package version string to install.

source

Overrides the top-level source registry for this individual workflow.

target

Overrides the destination filename for the installed workflow.

update-triggers

Controls whether custom modifications to workflow triggers are preserved during updates.

update-envs

Controls whether custom environment variables are preserved during updates.

update-config-files

Controls the overwrite behavior of companion configuration files bundled with the workflow.


File Update Behavior Matrix

File Type First Install Update (update-*: false) Update (update-*: true) Prune
Workflow File (.github/workflows/*) Created with managed header Updated in place; preserves local on: and env: Updated in place; overwrites on: and env: Removed if deleted from manifest
Config File (e.g. .eslintrc.json) Created only if file does not exist Untouched Overwritten with packaged version Never removed

Managed Header Format

Every workflow file installed by ghwm prepends a four-line managed header:

# Managed by ghwm (<name>@<version>)
# Source: @<org>/<name>:<source-file>
# Hash: sha256:<hex>
# Re-run `ghwm install` to refresh this file.

ghwm.lock

The lockfile records resolved package versions, file destinations, and content hashes. It guarantees deterministic installations across environments.

Commit ghwm.lock alongside ghwm.yml in source control.

Lockfile Schema (Version 1)

{
  "lockfileVersion": 1,
  "packages": [
    {
      "name": "auto-assign-pr",
      "version": "2.0.0",
      "source": "@owner/auto-assign-pr",
      "files": [
        {
          "target": ".github/workflows/auto-assign-pr.yaml",
          "source_hash": "sha256:5a0e5ccd00cd8e850e1068707e042339e182190eb89f8a300f58c18f53876059"
        },
        {
          "target": ".github/auto_assign.yaml",
          "source_hash": "sha256:caa9a086baaf9e0f7cd71f64edfa83da6821c05e826b083221f3d02e3d6a1905",
          "overwrite": false
        }
      ]
    }
  ]
}

Package Entry Fields

Field Type Description
name string Workflow identifier matching the manifest entry.
version string Pinned package version.
source string Scoped npm package identifier (@<owner>/<name>).
files array List of files installed and tracked for this package.

File Entry Fields

Field Type Description
target string Relative file path in the consumer repository.
source_hash string sha256 checksum of the normalized content written to disk.
overwrite boolean Set to false when a config file must be preserved on update.

Synced from ghwfxlab/ghwm v1.12.0. View source on GitHub