Feat/allow ghe changelog (#1981)
This PR follows up and fixes #1968 The previous PR didn't behave correctly as it was expecting Github Enterprise to ALWAYS been configured and that the github.com token was available in the `GITHUB_COM_TOKEN` env variable. But for non GHE project `GITHUB_COM_TOKEN` is not defined and github.com token is available at the `GITHUB_TOKEN` env variable instead. This updated PR fix this issue and avoid further problems by prioritising `github.com` over GHE. Now the code is NOOP if no `GITHUB_ENDPOINT` is configured. If it's configured, instead, now the codes assumes that, by DEFAULT, a dependency is hosted on `github.com` so it removes `GITHUB_ENDPOINT` and use `GITHUB_COM_TOKEN` as Github token immediately. They are restored only if needed, when a dependency is hosted on the provided GithubEnterprise.
Showing
- lib/datasource/npm.js 11 additions, 1 deletionlib/datasource/npm.js
- lib/workers/pr/changelog/index.js 82 additions, 14 deletionslib/workers/pr/changelog/index.js
- lib/workers/pr/changelog/source-github.js 9 additions, 10 deletionslib/workers/pr/changelog/source-github.js
- lib/workers/pr/index.js 0 additions, 16 deletionslib/workers/pr/index.js
- lib/workers/pr/release-notes.js 23 additions, 15 deletionslib/workers/pr/release-notes.js
- test/workers/pr/__snapshots__/changelog.spec.js.snap 199 additions, 0 deletionstest/workers/pr/__snapshots__/changelog.spec.js.snap
- test/workers/pr/changelog.spec.js 44 additions, 0 deletionstest/workers/pr/changelog.spec.js
- test/workers/pr/index.spec.js 1 addition, 0 deletionstest/workers/pr/index.spec.js
- test/workers/pr/release-notes.spec.js 40 additions, 8 deletionstest/workers/pr/release-notes.spec.js
Loading
Please register or sign in to comment