Skip to main content

GitHub Workflow Manager CLI

Lint Code Base version codecov Python

ghwm CLI

Install managed GitHub workflow files from a central marketplace repository.

Workflows can be sourced from the official ghwfxlab/ghwm-registry or your own registry repository (see Create your own registry). Workflow authors can annotate packages with presentation metadata using commented YAML frontmatter.

Why ghwm?

Teams copy the same GitHub Actions workflows from repository to repository. Over time the copies drift, nobody knows which version or edit is running where, and security fixes never reach every repository.

ghwm treats workflows as versioned packages. You list them in ghwm.yml, ghwm install writes them to .github/workflows/, and ghwm.lock records exactly what was installed. Updates keep your local on: triggers by default, and files that ghwm does not manage are skipped unless you pass --force.

  • Compared with reusable workflows: a reusable workflow is called remotely, so the logic lives outside your repository and you can't tune the file. ghwm installs a real file you can read, review and adjust.
  • Compared with starter workflows: a starter workflow is a one-time copy with no update path. ghwm tracks versions and hashes, so ghwm update brings in new releases.

Built-in security

Run ghwm audit to scan every managed workflow with zizmor and get a Security Score from 0 to 100. It exits with 1 on High or Medium findings, so it works as a CI gate. See Auditing Workflows.

Install

The recommended way to install ghwm is using uv (a fast Python package manager):

uv tool install ghwm

Or pin to a specific version:

uv tool install ghwm==X.Y.Z

Alternatives

If you prefer to install using pipx:

pipx install ghwm

Or via standard pip (into an active virtual environment):

pip install ghwm

To try the latest unreleased code from main, install straight from Git:

uv tool install git+https://github.com/ghwfxlab/ghwm.git

Usage

1. Create ghwm.yml in your repository root

A minimal manifest needs a registry source and a name and version for each workflow:

source: ghwfxlab/ghwm-registry

workflows:
  - name: super-linter  # Required.
    version: "2.0.1"    # Required for remote installs.

Full example

This example uses every supported key. Each comment states whether the key is required and the default that applies when you omit it.

# Default registry in owner/repository form.
# Optional. Default: owner/ghwm-registry
source: ghwfxlab/ghwm-registry

workflows:
  - name: auto-assign-pr                # Required.
    version: "1.0.2"                    # Required for remote installs. Default: none (only allowed with --local)
    source: other-owner/other-registry  # Optional. Default: the global `source`
    target: assign-pr.yml               # Optional. Default: the filename packaged in the workflow
    # The update-* options only apply on update. false keeps the local value, true replaces it with the packaged one.
    update-triggers: true               # Default: false. Replaces the local `on:` block
    update-envs: true                   # Default: false. Replaces the local `env:` block
    update-runs-on: true                # Default: false. Replaces each job's local `runs-on`
    update-config-files: true           # Default: false. Overwrites packaged config files

version is required for registry installs. By default, workflows are resolved from the global source. You can override this on a per-workflow basis by adding a source: other-owner/other-registry property to a workflow entry. The CLI resolves each workflow to a GitHub Packages npm package named @<source owner>/<name>.

If you want to override the generated workflow filename, add target: my-review.yml to the workflow entry. For the complete schema, field types, and defaults, see the Manifest and Lockfile Reference.

2. Install workflows

ghwm install            # installs workflows listed in ghwm.yml
ghwm install --force    # overwrites even if files were modified locally
ghwm install --no-prune # skip removal of stale workflows
ghwm install --update-triggers # replace workflow triggers with the packaged version
ghwm install --update-envs # replace workflow env variables with the packaged version
ghwm install --update-runs-on # replace each job's runs-on with the packaged version
ghwm upgrade            # automatically resolve, pin, and install latest versions
ghwm update             # re-downloads all workflows (respects versions)
ghwm update --prune     # also removes managed workflows no longer in ghwm.yml
ghwm update --update-triggers # replace workflow triggers with the packaged version
ghwm update --update-envs # replace workflow env variables with the packaged version
ghwm update --update-runs-on # replace each job's runs-on with the packaged version
ghwm list               # shows workflows declared in ghwm.yml
ghwm audit              # audits managed workflows for security vulnerabilities

Workflow files are written to .github/workflows/ with a managed header. Additional packaged files such as config files are written as-is. On first install, config files are only created if the target does not already exist. On update, config files are only overwritten when update-config-files: true is set for that workflow.

File type First install Update Prune
Workflow file (.github/workflows/*) Install with managed header Update in place; preserve existing on: by default Remove
Packaged config file Create only when missing Overwrite only with update-config-files: true Keep

Managed files

Every installed workflow file starts with a header that marks it as managed:

# Managed by ghwm (linter@0.1.4)
# Source: @owner/linter:linter.yml
# Hash: sha256:...
# Re-run `ghwm install` to refresh this file.

The CLI uses this header to:

  • Distinguish managed files from hand-crafted ones (unmanaged files are never overwritten without --force).
  • Preserve existing on: rules during updates unless update-triggers: true or --update-triggers is used.
  • Preserve existing env: variables during updates unless update-envs: true or --update-envs is used.
  • Preserve each job's existing runs-on during updates, matched by job ID, unless update-runs-on: true or --update-runs-on is used. Jobs added in a newer package version take the packaged runs-on, and a notice is printed when a preserved job no longer exists in the package.
  • Prune stale workflow files that were removed from the manifest.

Config files do not get a managed header and are never removed during prune.

Use ghwm update --prune when you want one command to refresh workflows that are still in ghwm.yml and remove managed workflows that were deleted from the manifest. It updates ghwm.lock too.

Lockfile

ghwm.lock is a JSON file that records every installed package and the files it manages:

{
  "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:..."
        },
        {
          "target": ".github/auto_assign.yaml",
          "source_hash": "sha256:...",
          "overwrite": false
        }
      ]
    }
  ]
}

Commit ghwm.lock alongside ghwm.yml so CI and teammates install the exact same workflow package set. Old tarball-era lockfiles are rejected and must be regenerated.

Auditing Workflows (Security Scoring)

Since workflows are imported from shared registry repositories, keeping them secure is critical. The ghwm audit command runs static security analysis on all your installed/managed workflows using zizmor (a fast security linter for GitHub Actions).

ghwm audit

If the linter is not installed locally, ghwm will attempt to execute it dynamically using uvx zizmor.

ghwm audit calculates a Security Score out of 100 on a logarithmic scale (exponential decay) to ensure the score never goes negative:

$$\text{Score} = \text{round}\left(100 \times e^{-\text{Deductions} / 100}\right)$$

where total Deductions are calculated from:

  • High severity: 20 points
  • Medium severity: 10 points
  • Low severity: 5 points
  • Informational: 1 point

If any High or Medium severity vulnerabilities are detected, ghwm audit exits with code 1, making it ideal for integration into CI pipelines.

Keep Workflows Updated (Renovate Integration)

Since ghwm resolves workflows to npm packages (e.g., @owner/<name>) published to GitHub Packages, you can use Renovate to automatically detect updates and open pull requests to update the versions in your ghwm.yml.

Add the following regexManagers configuration to your renovate.json or renovate.json5 file:

{
  "regexManagers": [
    {
      "fileMatch": ["^ghwm\\.yml$"],
      "matchStrings": [
        "name:\\s+(?<depName>\\S+)\\s+version:\\s+[\"']?(?<currentValue>[^\"'\\s]+)[\"']?"
      ],
      "datasourceTemplate": "npm",
      "depNameTemplate": "@owner/{{depName}}",
      "registryUrlTemplates": ["https://npm.pkg.github.com"]
    }
  ]
}

Note: Replace @owner with the GitHub organization or username where your registry packages are published.

Authentication

The CLI needs read access to GitHub Packages and the marketplace repository. The CLI looks for authentication in the following order:

  1. Active gh CLI credentials (using the output of gh auth token)
  2. GH_TOKEN environment variable
  3. GITHUB_TOKEN environment variable

For example, you can set an environment variable:

export GH_TOKEN=ghp_...
# or
export GITHUB_TOKEN=ghp_...

If you rely on the gh CLI, ensure that its active token has read:packages access. You can add this scope if needed by running:

gh auth refresh -s read:packages

Local Development

Point at a local checkout of the registry for testing:

ghwm install --local ../ghwm-registry

With --local, the CLI reads workflows/<name>/workflow.yml directly from the checkout instead of downloading the npm package tarball.

Telemetry & Privacy

ghwm collects anonymous, privacy-gated usage telemetry to understand which workflow packages are being adopted. Here is exactly what is tracked and what is not:

What is tracked:

Field Example
Registry source owner/ghwm-registry
Workflow name linter
Workflow version 1.2.3
Event type install (first time added) or updated (workflow changed on re-install)
Workflow metadata (optional) Title, description, tags, icon, owner, version, source, created_at (see Workflow Frontmatter Specification)

What is never tracked: IP addresses, hostnames, usernames, file paths, repository names, environment variables, or any other system or user information.

Privacy gate

Telemetry is only emitted when the workflow registry is a public GitHub repository. Before sending any data, ghwm calls the GitHub REST API (GET /repos/{owner}/{repo}) without authentication to check the visibility of each workflow's resolved source registry. If a registry is private, internal, or if the check fails for any reason (network error, rate limit, missing permissions), telemetry is skipped silently for that workflow and the install continues normally.

This means workflows sourced from private or internal enterprise registries are never tracked, protecting proprietary workflow IP.

Opting out

You can disable telemetry for a single run with the --no-telemetry flag:

ghwm install --no-telemetry
ghwm update --no-telemetry
ghwm upgrade --no-telemetry

To opt out permanently — for example in CI/CD pipelines or a global shell config — set either the DO_NOT_TRACK=1 environment variable (consoledonottrack.com) or GHWM_NO_TELEMETRY=1:

export DO_NOT_TRACK=1
# or
export GHWM_NO_TELEMETRY=1

Create your own registry

A registry is a GitHub repository whose workflows/ folder holds one npm package per workflow, published to GitHub Packages. The official ghwfxlab/ghwm-registry is a good reference to copy from.

  1. Create a repository, for example my-org/ghwm-registry. The owner becomes the npm scope (@my-org/<name>).

  2. Add a folder per workflow, such as workflows/linter/, containing the workflow file, any config files, a package.json and a workflow.yml:

    # workflows/linter/workflow.yml
    name: linter
    files:
      - source: linter.yaml
        target: .github/workflows/linter.yaml
    

    Optionally add commented frontmatter with a title, description and tags.

  3. Set "name": "@my-org/linter" and "publishConfig": {"registry": "https://npm.pkg.github.com"} in package.json, and list the same files under "files".

  4. Test locally from a consumer repository, without publishing:

    ghwm install --local ../ghwm-registry
    
  5. Publish each package to GitHub Packages (the official registry does this from a publish workflow on every push to main), then set the package visibility to Public if consumers outside your organization need it.

  6. Point consumers at it in ghwm.yml:

    source: my-org/ghwm-registry
    workflows:
      - linter@1.0.0
    

Development

make install          # uv sync (dev deps)
make test             # pytest
make test-e2e         # run end-to-end tests using testcontainers
make lint             # ruff check
make format           # ruff format
make type-check       # mypy
make lang             # textlint for prose/documentation
make precommit        # run pre-commit hooks on all files
make super-linter     # run super-linter via Docker
make clean            # remove build artifacts

Architecture

See ARCHITECTURE.md for design details.

License

MIT

Metadata

Release files for ghwm 1.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghwm 1.13.0
File Size Uploaded Provenance Actions
ghwm-1.13.0.tar.gz 284.6 kB With provenance Details for ghwm-1.13.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ghwm 1.13.0
File Interpreter ABI Platform Actions
ghwm-1.13.0-py3-none-any.whl Python 3 none any Details for ghwm-1.13.0-py3-none-any.whl

Total release size: 317.7 kB

Release files / ghwm-1.13.0.tar.gz

Download URL ghwm-1.13.0.tar.gz
Size 284.6 kB
Tags Source
SHA-256 checksum
How to use checksums
361bb0a931008471d5a343145e45cf924ca91cf2ac4969acba77541d3131e602
BLAKE2b-256 checksum
How to use checksums
cd90c250399afdc2ba69e75aff14313775077261a3856e69d79ba26587622d81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / ghwm-1.13.0-py3-none-any.whl

Download URL ghwm-1.13.0-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e11932430ebb02ec6bafd434a0e9b256f4041e6d4526e1382f2aee897bbe799
BLAKE2b-256 checksum
How to use checksums
d16a6c835cfe4d44c2948eddfb4f342505fa6f3e24579fc9cecd8840ddc02de1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for ghwm 1.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ghwm-1.13.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page