From 30be24c97d7ebd2dbd62640b65f65c1186dbea1f Mon Sep 17 00:00:00 2001 From: Shohei Ueda <30958501+peaceiris@users.noreply.github.com> Date: Fri, 3 Jan 2020 19:54:11 +0900 Subject: [PATCH] refactor: Remove invalid exception (#32) --- src/get-latest-version.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/get-latest-version.ts b/src/get-latest-version.ts index e115522..2c5f3bc 100644 --- a/src/get-latest-version.ts +++ b/src/get-latest-version.ts @@ -1,4 +1,4 @@ -import * as core from '@actions/core'; +const XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; interface BrewVersions { stable: string; @@ -12,8 +12,6 @@ export interface JsonGithub { tag_name: string; } -const XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; - export function getURL(org: string, repo: string, api: string): string { let url: string = ''; @@ -21,8 +19,6 @@ export function getURL(org: string, repo: string, api: string): string { url = `https://formulae.brew.sh/api/formula/${repo}.json`; } else if (api === 'github') { url = `https://api.github.com/repos/${org}/${repo}/releases/latest`; - } else { - core.setFailed(`Source API ${api} is not supported.`); } return url;