Config-help: Can't get Github release notes token working

Created on 6 Feb 2020  路  3Comments  路  Source: renovatebot/config-help

Which Renovate are you using?

Renovate Open Source CLI (running as docker image)

Which platform are you using?

GitHub Enterprise

Have you checked the logs? Don't forget to include them if relevant

 WARN: No github.com token has been configured. Skipping release notes retrieval (repository=<SNIP>, branch=renovate/github.com-sirupsen-logrus-1.x)
       "manager": "gomod",
       "depName": "github.com/sirupsen/logrus",
       "sourceUrl": "https://github.com/sirupsen/logrus"

What would you like to do?

Trying to get the github.com token working. I have tried both methods here: https://docs.renovatebot.com/install-gitlab-app/#configuring-the-token

I used the app at https://renovatebot.com/encrypt to encrypt my personal token, and I've tried putting the relevant config in multiple places to get it working, to no avail.

I've tried putting this in the config.js:

  hostRules: [
    {
      domainName: 'github.com',
      encrypted: {
        token: '<SNIP>'
      },
    },
  ],

Did not work. I tried :githubComToken() in the config.js, same issue. Then I tried putting it in renovate.js in the repo:

  "hostRules": [
    {
      "domainName": "github.com",
      "encrypted": {
        "token": "<SNIP>"
      }
    }
  ]

But in this case I get this:

 INFO: Repository config (repository=<SNIP>)
       "configFile": "renovate.json",
       "config": {
         "extends": ["config:base"],
         "hostRules": [
           {"domainName": "github.com", "encrypted": {"token": "***********"}}
         ]
       }
ERROR: Found encrypted data but no privateKey (repository=<SNIP>)
 INFO: Setting hostRules from config (repository=<SNIP>)

I'm at a loss here - any idea what I'm doing wrong?

Most helpful comment

Just in case anyone else is trying the hostRules approach from above: did not work for me, either @rarkins

Setting the environment variable works, as already reported by @diagonalfish .

All 3 comments

The encrypting of fields is only valid for when you use the hosted WhiteSource Renovate app. When you encrypt it in the webpage you're encrypting the data with WhiteSource's public key and then we use our private key to decrypt it. When you are running Renovate yourself, you naturally don't have our private key in order to decrypt.

The simplest way to configure a token is to export it in env like export GITHUB_COM_TOKEN=......

Otherwise use this host rule in your bot's config.json:

  "hostRules": [
    {
      "domainName": "github.com",
      "token": "replace with your unencrypted personal access token"
    }
  ]

Thanks. That was the missing info I needed. With the environment variable I managed to get it working fine.

Sorry about the wacky title. Got distracted in the middle of typing it and never came back to finish it. 馃檭

Just in case anyone else is trying the hostRules approach from above: did not work for me, either @rarkins

Setting the environment variable works, as already reported by @diagonalfish .

Was this page helpful?
0 / 5 - 0 ratings