mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
refactor(conan): retrieve raw content directly from GitHub (#14195)
This commit is contained in:
parent
8a7abfdf01
commit
766d92144f
4 changed files with 20 additions and 22 deletions
15
lib/datasource/conan/__fixtures__/poco.yaml
Normal file
15
lib/datasource/conan/__fixtures__/poco.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
versions:
|
||||
"1.11.1":
|
||||
folder: all
|
||||
"1.11.0":
|
||||
folder: all
|
||||
"1.10.1":
|
||||
folder: all
|
||||
"1.10.0":
|
||||
folder: all
|
||||
"1.9.3":
|
||||
folder: all
|
||||
"1.9.4":
|
||||
folder: all
|
||||
"1.8.1":
|
||||
folder: all
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"name": "config.yml",
|
||||
"path": "recipes/poco/config.yml",
|
||||
"sha": "ade8cc1fda69a36ad5a23ad903a4b76223393ca2",
|
||||
"size": 203,
|
||||
"url": "https://api.github.com/repos/conan-io/conan-center-index/contents/recipes/poco/config.yml?ref=master",
|
||||
"html_url": "https://github.com/conan-io/conan-center-index/blob/master/recipes/poco/config.yml",
|
||||
"git_url": "https://api.github.com/repos/conan-io/conan-center-index/git/blobs/ade8cc1fda69a36ad5a23ad903a4b76223393ca2",
|
||||
"download_url": "https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/poco/config.yml",
|
||||
"type": "file",
|
||||
"content": "dmVyc2lvbnM6CiAgIjEuMTEuMSI6CiAgICBmb2xkZXI6IGFsbAogICIxLjEx\nLjAiOgogICAgZm9sZGVyOiBhbGwKICAiMS4xMC4xIjoKICAgIGZvbGRlcjog\nYWxsCiAgIjEuMTAuMCI6CiAgICBmb2xkZXI6IGFsbAogICIxLjkuMyI6CiAg\nICBmb2xkZXI6IGFsbAogICIxLjkuNCI6CiAgICBmb2xkZXI6IGFsbAogICIx\nLjguMSI6CiAgICBmb2xkZXI6IGFsbAo=\n",
|
||||
"encoding": "base64",
|
||||
"_links": {
|
||||
"self": "https://api.github.com/repos/conan-io/conan-center-index/contents/recipes/poco/config.yml?ref=master",
|
||||
"git": "https://api.github.com/repos/conan-io/conan-center-index/git/blobs/ade8cc1fda69a36ad5a23ad903a4b76223393ca2",
|
||||
"html": "https://github.com/conan-io/conan-center-index/blob/master/recipes/poco/config.yml"
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ import { defaultRegistryUrl } from './common';
|
|||
import { ConanDatasource } from '.';
|
||||
|
||||
const pocoJson = Fixtures.get('poco.json');
|
||||
const pocoYamlGitHubContent = Fixtures.get('poco.yaml.json');
|
||||
const pocoYamlGitHubContent = Fixtures.get('poco.yaml');
|
||||
const malformedJson = Fixtures.get('malformed.json');
|
||||
const fakeJson = Fixtures.get('fake.json');
|
||||
const datasource = ConanDatasource.id;
|
||||
|
|
|
@ -37,9 +37,10 @@ export class ConanDatasource extends Datasource {
|
|||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/conan-io/conan-center-index/contents/recipes/${depName}/config.yml`;
|
||||
const res = await this.githubHttp.getJson<{ content: string }>(url);
|
||||
const content = Buffer.from(res.body.content, 'base64').toString('utf8');
|
||||
const doc = load(content, {
|
||||
const res = await this.githubHttp.get(url, {
|
||||
headers: { Accept: 'application/vnd.github.v3.raw' },
|
||||
});
|
||||
const doc = load(res.body, {
|
||||
json: true,
|
||||
}) as ConanYAML;
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue