chore(deps): move from node-fetch to undici (#1148)

* chore(deps): move from node-fetch to undici

* fix: lint

* test: see if this is actually running

* test: skeptical

* test: post-install
This commit is contained in:
Tom Hu
2023-10-25 06:08:39 -07:00
committed by GitHub
parent aceeca9bb1
commit 83d30f0e41
6 changed files with 25576 additions and 13086 deletions

View File

@@ -1,5 +1,5 @@
import * as core from '@actions/core';
import * as fetch from 'node-fetch';
import {request} from 'undici';
const versionInfo = async (
platform: string,
@@ -10,10 +10,10 @@ const versionInfo = async (
}
try {
const metadataRes = await fetch.default( `https://uploader.codecov.io/${platform}/latest`, {
const metadataRes = await request(`https://uploader.codecov.io/${platform}/latest`, {
headers: {'Accept': 'application/json'},
});
const metadata = await metadataRes.json();
const metadata = await metadataRes.body.json();
core.info(`==> Running version ${metadata['version']}`);
} catch (err) {
core.info(`Could not pull latest version information: ${err}`);