mirror of
https://github.com/subosito/flutter-action.git
synced 2024-08-16 10:19:50 +02:00
use @actions/http-client
This commit is contained in:
parent
973907784f
commit
b749ad466c
1 changed files with 5 additions and 5 deletions
|
@ -3,7 +3,7 @@ import * as io from '@actions/io';
|
|||
import * as tc from '@actions/tool-cache';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as restm from 'typed-rest-client/RestClient';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import * as semver from 'semver';
|
||||
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
|
@ -168,10 +168,10 @@ async function getLatestVersion(
|
|||
channel: string
|
||||
): Promise<string> {
|
||||
const releasesUrl: string = `${storageUrl}/releases_${osName()}.json`;
|
||||
const rest: restm.RestClient = new restm.RestClient('flutter-action');
|
||||
const storage: IFlutterStorage | null = (await rest.get<IFlutterStorage | null>(
|
||||
releasesUrl
|
||||
)).result;
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('flutter-action');
|
||||
const storage: IFlutterStorage | null = (
|
||||
await http.getJson<IFlutterStorage | null>(releasesUrl)
|
||||
).result;
|
||||
|
||||
if (!storage) {
|
||||
throw new Error('unable to get latest version');
|
||||
|
|
Loading…
Reference in a new issue