最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to runtest renovate bot locally? - Stack Overflow

programmeradmin5浏览0评论

Before I configure renovate to work with my Azure pipeline, how can I run npx renovate locally to check does it work as I expect and does my config file is well configured. I'm trying with npx renovate --platform local mand.

My project is based on JS/React so I have installed renovate via npm.

I'm getting warn message: Unknown error fetching default owner preset

this is my config.js file: `const config = { extends: ['config:remended'], };

export default config;`

I've found inside renovate documentation something related to local presets but not sure how can I configure or set it.

documentation: Local presets¶ Renovate also supports local presets, e.g. presets that are hosted on the same platform as the target repository. This is especially helpful in self-hosted scenarios where public presets cannot be used. Local presets are specified either by leaving out any prefix, e.g. owner/name, or explicitly by adding a local> prefix, e.g. local>owner/name. Renovate will determine the current platform and look up the preset from there.

info from console:

INFO: Repository finished (repository=local) "cloned": undefined, "durationMs": 434 INFO: Renovate is exiting with a non-zero code due to the following logged errors "loggerErrors": [ { "name": "renovate", "level": 50, "logContext": "LHh5xmukB832iVr6l_qFS", "repository": "local", "err": { "message": "Cannot read properties of undefined (reading '')", "stack": "TypeError: Cannot read properties of undefined (reading '')\n

this is my renovate.json file:

{
  "onboardingConfig": { "extends": ["config:remended"] },
  "packageRules": [
    {
      "matchPackageNames": ["*"],
      "automerge": false
    }
  ]
}

this is my config.js file

module.exports = {
  platform: 'azure',
  endpoint: '/',
  token: process.env.TOKEN,
  hostRules: [
    {
      hostType: 'npm',
      matchHost: 'pkgs.dev.azure',
      username: 'apikey',
      password: process.env.TOKEN,
    },
  ],
  repositories: ['my repository'],
};

Any help is more than wele!

Before I configure renovate to work with my Azure pipeline, how can I run npx renovate locally to check does it work as I expect and does my config file is well configured. I'm trying with npx renovate --platform local mand.

My project is based on JS/React so I have installed renovate via npm.

I'm getting warn message: Unknown error fetching default owner preset

this is my config.js file: `const config = { extends: ['config:remended'], };

export default config;`

I've found inside renovate documentation something related to local presets but not sure how can I configure or set it.

documentation: Local presets¶ Renovate also supports local presets, e.g. presets that are hosted on the same platform as the target repository. This is especially helpful in self-hosted scenarios where public presets cannot be used. Local presets are specified either by leaving out any prefix, e.g. owner/name, or explicitly by adding a local> prefix, e.g. local>owner/name. Renovate will determine the current platform and look up the preset from there.

info from console:

INFO: Repository finished (repository=local) "cloned": undefined, "durationMs": 434 INFO: Renovate is exiting with a non-zero code due to the following logged errors "loggerErrors": [ { "name": "renovate", "level": 50, "logContext": "LHh5xmukB832iVr6l_qFS", "repository": "local", "err": { "message": "Cannot read properties of undefined (reading '')", "stack": "TypeError: Cannot read properties of undefined (reading '')\n

this is my renovate.json file:

{
  "onboardingConfig": { "extends": ["config:remended"] },
  "packageRules": [
    {
      "matchPackageNames": ["*"],
      "automerge": false
    }
  ]
}

this is my config.js file

module.exports = {
  platform: 'azure',
  endpoint: 'https://dev.azure./myend-point/',
  token: process.env.TOKEN,
  hostRules: [
    {
      hostType: 'npm',
      matchHost: 'pkgs.dev.azure.',
      username: 'apikey',
      password: process.env.TOKEN,
    },
  ],
  repositories: ['my repository'],
};

Any help is more than wele!

Share Improve this question edited Dec 26, 2023 at 13:51 Dejan asked Dec 25, 2023 at 16:53 DejanDejan 3275 silver badges15 bronze badges 2
  • 1 Enable more logs maybe? There's a log level variable that you can set to DEBUG. Maybe it'll give you more info about the error. – Gaël J Commented Dec 26, 2023 at 13:10
  • @GaëlJ question has been updated with more info. – Dejan Commented Dec 26, 2023 at 13:52
Add a ment  | 

2 Answers 2

Reset to default 5

It looks like there may be a problem with renovate detecting the onboarding status, as the stack trace from the full error mentions checkOnboardingBranch.

I was able to debug my renovate configuration locally by skipping the onboarding check:

LOG_LEVEL=debug npx renovate --platform=local --onboarding=false

If you want to validate the renovate.json only then you can use the following mand to validate it locally.

npx --package renovate -c 'renovate-config-validator'

You could automate it and put the following action in the github actions to make it as part of your CI/CD workflow.

name: Renovate

on:
  pull_request_target:
    types:
    - opened
    - edited
    - synchronize
    paths:
    - .github/workflows/renovate.yaml
    - renovate.json

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Renovate Config Validation
      uses: rinchsan/[email protected]
      with:
        pattern: 'renovate.json'

发布评论

评论列表(0)

  1. 暂无评论