mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-06 06:29:24 +00:00
fetch.default
This commit is contained in:
parent
351baf62fa
commit
d4729eeb39
7 changed files with 1626 additions and 1257 deletions
|
|
@ -4,7 +4,7 @@ import * as path from 'path';
|
|||
|
||||
import * as core from '@actions/core';
|
||||
import * as openpgp from 'openpgp';
|
||||
import fetch from 'node-fetch';
|
||||
import * as fetch from 'node-fetch';
|
||||
|
||||
import {
|
||||
getBaseUrl,
|
||||
|
|
@ -24,12 +24,12 @@ const verify = async (filename: string, platform: string, version: string) => {
|
|||
|
||||
// Get SHASUM and SHASUM signature files
|
||||
console.log(`${getBaseUrl(platform, version)}.SHA256SUM`);
|
||||
const shasumRes = await fetch(
|
||||
const shasumRes = await fetch.default(
|
||||
`${getBaseUrl(platform, version)}.SHA256SUM`,
|
||||
);
|
||||
const shasum = await shasumRes.text();
|
||||
|
||||
const shaSigRes = await fetch(
|
||||
const shaSigRes = await fetch.default(
|
||||
`${getBaseUrl(platform, version)}.SHA256SUM.sig`,
|
||||
);
|
||||
const shaSig = await shaSigRes.text();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as core from '@actions/core';
|
||||
import fetch from 'node-fetch';
|
||||
import * as fetch from 'node-fetch';
|
||||
|
||||
const versionInfo = async (platform: string, version?: string) => {
|
||||
if (version) {
|
||||
|
|
@ -7,7 +7,7 @@ const versionInfo = async (platform: string, version?: string) => {
|
|||
}
|
||||
|
||||
try {
|
||||
const metadataRes = await fetch( `https://uploader.codecov.io/${platform}/latest`, {
|
||||
const metadataRes = await fetch.default( `https://uploader.codecov.io/${platform}/latest`, {
|
||||
headers: {'Accept': 'application/json'},
|
||||
});
|
||||
const metadata = await metadataRes.json();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue