Skip to content

Helper Presets

helpers:disableTypesNodeMajor

Disable major updates to @types/node.

{
  "packageRules": [
    {
      "enabled": false,
      "matchPackageNames": [
        "@types/node"
      ],
      "matchUpdateTypes": [
        "major"
      ]
    }
  ]
}

helpers:followTypescriptNext(<arg0>, <arg1>)

Keep typescript version in sync with the next tag.

{
  "extends": [
    ":followTag(typescript, next)" // (1)!
  ]
}
  1. :followTag(typescript, next): For package arg0, strictly follow release tag arg1.

helpers:followTypescriptRc(<arg0>, <arg1>)

Keep typescript version in sync with the rc tag.

{
  "extends": [
    ":followTag(typescript, rc)" // (1)!
  ]
}
  1. :followTag(typescript, rc): For package arg0, strictly follow release tag arg1.

helpers:forgejoDigestChangelogs

Ensure that every dependency pinned by digest and sourced from Forgejo contains a link to the commit-to-commit diff

{
  "packageRules": [
    {
      "changelogUrl": "{{sourceUrl}}/compare/{{currentDigest}}..{{newDigest}}",
      "matchDatasources": [
        "forgejo-releases",
        "forgejo-tags"
      ],
      "matchUpdateTypes": [
        "digest"
      ]
    },
    {
      "changelogUrl": "{{sourceUrl}}/compare/{{currentDigest}}..{{newDigest}}",
      "matchDatasources": [
        "git-refs",
        "git-tags"
      ],
      "matchJsonata": [
        "$detectPlatform(sourceUrl) = 'forgejo'"
      ],
      "matchUpdateTypes": [
        "digest"
      ]
    }
  ]
}

helpers:giteaDigestChangelogs

Ensure that every dependency pinned by digest and sourced from Gitea contains a link to the commit-to-commit diff

{
  "packageRules": [
    {
      "changelogUrl": "{{sourceUrl}}/compare/{{currentDigest}}..{{newDigest}}",
      "matchDatasources": [
        "gitea-releases",
        "gitea-tags"
      ],
      "matchUpdateTypes": [
        "digest"
      ]
    },
    {
      "changelogUrl": "{{sourceUrl}}/compare/{{currentDigest}}..{{newDigest}}",
      "matchDatasources": [
        "git-refs",
        "git-tags"
      ],
      "matchJsonata": [
        "$detectPlatform(sourceUrl) = 'gitea'"
      ],
      "matchUpdateTypes": [
        "digest"
      ]
    }
  ]
}

helpers:githubDigestChangelogs

Ensure that every dependency pinned by digest and sourced from GitHub.com and Github enterprise contains a link to the commit-to-commit diff

{
  "packageRules": [
    {
      "changelogUrl": "{{sourceUrl}}/compare/{{currentDigest}}..{{newDigest}}",
      "matchDatasources": [
        "github-digest",
        "github-releases",
        "github-tags"
      ],
      "matchUpdateTypes": [
        "digest"
      ]
    },
    {
      "changelogUrl": "{{sourceUrl}}/compare/{{currentDigest}}..{{newDigest}}",
      "matchDatasources": [
        "git-refs",
        "git-tags"
      ],
      "matchJsonata": [
        "$detectPlatform(sourceUrl) = 'github'"
      ],
      "matchUpdateTypes": [
        "digest"
      ]
    }
  ]
}

Correctly link to the source code for golang.org/x packages

{
  "packageRules": [
    {
      "matchManagers": [
        "gomod"
      ],
      "matchUpdateTypes": [
        "major",
        "minor",
        "patch"
      ],
      "prBodyDefinitions": {
        "Change": "{{#if (containsString depName 'golang.org/x/')}}[`{{{displayFrom}}}` → `{{{displayTo}}}`](https://cs.opensource.google/{{{replace '^golang\\.org' 'go' depName}}}/+/refs/tags/{{{currentValue}}}...refs/tags/{{{newValue}}}){{else}}`{{{displayFrom}}}` → `{{{displayTo}}}`{{/if}}"
      }
    }
  ]
}

Link to pkg.go.dev/... for golang.org/x packages' title

{
  "packageRules": [
    {
      "matchManagers": [
        "gomod"
      ],
      "prBodyDefinitions": {
        "Package": "{{#if (containsString depName 'golang.org/x/')}}[{{{depName}}}](https://pkg.go.dev/{{{depName}}}){{else}}{{{depNameLinked}}}{{/if}}"
      }
    }
  ]
}

helpers:pinGitHubActionDigests

Pin github-action digests.

{
  "packageRules": [
    {
      "matchDepTypes": [
        "action"
      ],
      "pinDigests": true
    }
  ]
}

helpers:pinGitHubActionDigestsToSemver

Convert pinned GitHub Action digests to SemVer.

{
  "packageRules": [
    {
      "extends": [
        "helpers:pinGitHubActionDigests" // (1)!
      ],
      "extractVersion": "^(?<version>v?\\d+\\.\\d+\\.\\d+)$",
      "versioning": "regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$"
    }
  ]
}
  1. helpers:pinGitHubActionDigests: Pin github-action digests.