Skip to content

Instantly share code, notes, and snippets.

@davidlj95
Last active June 4, 2024 14:22
Show Gist options
  • Save davidlj95/69d89fa0c654a8ed1768b267a065b247 to your computer and use it in GitHub Desktop.
Save davidlj95/69d89fa0c654a8ed1768b267a065b247 to your computer and use it in GitHub Desktop.
Print Renovate configuration
# Local
LOG_LEVEL=debug pnpm dlx renovate \
--platform local \
--print-config true
# GitHub hosted
REPO="user/repo"
LOG_LEVEL=debug pnpm dlx renovate \
--dry-run extract \
--print-config true \
--token $GITHUB_TOKEN \
$REPO
@davidlj95
Copy link
Author

davidlj95 commented Jun 1, 2024

Print Renovate configuration

Of a repository. Useful when wanting to debug what's the configuration that Renovate's GitHub app is using. For instance when extending presets.

Usage

Examples use pnpm. But you can change pnpm dlx by npx if using npm instead

Local

Renovate uses local file system as platform. This way you can see how current configuration in the file system is fully resolved.

--dry-run is not needed as defaults to lookup. Checkout all dry run modes

Note

Seems when using local platform it won't properly lookup dependency updates for GitHub Actions

WARN: GitHub token is required for some dependencies`
      "githubDeps": [
        "pnpm/action-setup",

Even if specifying a valid token with --token. Probably due to local repository config.

GitHub

To see the resolved configuration of an existing GitHub repository. It will use base branch for the repository.

Not sure how to setup a different branch from CLI. baseBranches argument is not present in CLI. But useBaseBranchConfig is

Set GITHUB_TOKEN env var with a GitHub Personal Access Token. Read only should be enough (see quirks)

Quirks

LFS

If the repository uses Git LFS, using GitHub (not local) platform (default) & the access token is a read-only fine-grained token, the command will fail due to an authorization error to get LFS files. You can either:

  • Temporarily disable LFS filters: you probably don't need the actual LFS files indeed. Run git lfs uninstall before running the command. Run git lfs install to restore Git LFS filters later.
  • Write access token: you can also use a classic personal access token with repository permission. This means public_repo scope for public repositories or repo scope for private repositories. Beware the token will have write permissions. --dry-run flag should instruct renovate to don't do any write op though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment