diff --git a/lib/datasource/conan/__fixtures__/poco.yaml b/lib/datasource/conan/__fixtures__/poco.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9ae83182c93f224f91e883a12bb7fd8714003056 --- /dev/null +++ b/lib/datasource/conan/__fixtures__/poco.yaml @@ -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 \ No newline at end of file diff --git a/lib/datasource/conan/__fixtures__/poco.yaml.json b/lib/datasource/conan/__fixtures__/poco.yaml.json deleted file mode 100644 index 9b2336d5d23bcc28de50be62cbbc9d7bcf74075f..0000000000000000000000000000000000000000 --- a/lib/datasource/conan/__fixtures__/poco.yaml.json +++ /dev/null @@ -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" - } -} diff --git a/lib/datasource/conan/index.spec.ts b/lib/datasource/conan/index.spec.ts index 6b917705e00a7ea063f741dd8061ce743429ab7e..756a936516cae960f500c91f0049f14692fdcb5b 100644 --- a/lib/datasource/conan/index.spec.ts +++ b/lib/datasource/conan/index.spec.ts @@ -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; diff --git a/lib/datasource/conan/index.ts b/lib/datasource/conan/index.ts index e2286f57394c618e023cf95ad5af23d21837ad2d..abb62555e021fed4d58cd6f2ce3058315d21aed7 100644 --- a/lib/datasource/conan/index.ts +++ b/lib/datasource/conan/index.ts @@ -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 {