mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-11 04:41:38 +00:00
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:
@@ -4,7 +4,7 @@ import * as path from 'path';
|
||||
|
||||
import * as core from '@actions/core';
|
||||
import * as openpgp from 'openpgp';
|
||||
import * as fetch from 'node-fetch';
|
||||
import {request} from 'undici';
|
||||
|
||||
import {
|
||||
getBaseUrl,
|
||||
@@ -30,18 +30,18 @@ const verify = async (
|
||||
|
||||
// Get SHASUM and SHASUM signature files
|
||||
console.log(`${getBaseUrl(platform, version)}.SHA256SUM`);
|
||||
const shasumRes = await fetch.default(
|
||||
const shasumRes = await request(
|
||||
`${getBaseUrl(platform, version)}.SHA256SUM`,
|
||||
);
|
||||
const shasum = await shasumRes.text();
|
||||
const shasum = await shasumRes.body.text();
|
||||
if (verbose) {
|
||||
console.log(`Received SHA256SUM ${shasum}`);
|
||||
}
|
||||
|
||||
const shaSigRes = await fetch.default(
|
||||
const shaSigRes = await request(
|
||||
`${getBaseUrl(platform, version)}.SHA256SUM.sig`,
|
||||
);
|
||||
const shaSig = await shaSigRes.text();
|
||||
const shaSig = await shaSigRes.body.text();
|
||||
if (verbose) {
|
||||
console.log(`Received SHA256SUM signature ${shaSig}`);
|
||||
}
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user