Skip to content

Instantly share code, notes, and snippets.

@sheldonhull
Last active August 10, 2023 19:48
Show Gist options
  • Save sheldonhull/01a1cc974ed135df0bb3643071cb2419 to your computer and use it in GitHub Desktop.
Save sheldonhull/01a1cc974ed135df0bb3643071cb2419 to your computer and use it in GitHub Desktop.
Renovate Config Validator via Trunk

Renovate Config Validator

If the default linting isn't matching the new files, you can run this manually with trunk.

This is an example of the trunk yaml modified to run explicitly against any json files.

lint:
  enabled:
    - taplo@0.7.0
    - git-diff-check
    - gitleaks@8.16.3
    - markdownlint@0.34.0
    - prettier@2.8.8
    - renovate@35.96.0
    - yamllint@1.31.0
    # - renovate-config-validator@36.42.0
  definitions:
    - name: renovate-config-validator
      good_without_config: true
      type: pass_fail
      success_codes: [0, 1]
      enabled: false
      runtime: node
      package: renovate
      files:
        - json
      command: [renovate-config-validator]

Then setup an action to run as pre-commit check instead.

actions:
  enabled:
    - trunk-check-pre-commit
    - trunk-announce
    - trunk-check-pre-push
    - trunk-fmt-pre-commit
    - trunk-upgrade-available
    - renovate-config-validator

  definitions:
    - id: renovate-config-validator
      description: Validate the config.
      interactive: false
      enabled: true
      # package: github.com/miniscruff/changie@latest
      triggers:
        - git_hooks:
            - pre-commit
      run: 'renovate-config-validator'
      notify_on_error: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment