Skip to content

Commit

Permalink
refactor: Remove invalid exception (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Jan 3, 2020
1 parent 258d379 commit 30be24c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/get-latest-version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as core from '@actions/core';
const XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;

interface BrewVersions {
stable: string;
Expand All @@ -12,17 +12,13 @@ export interface JsonGithub {
tag_name: string;
}

const XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;

export function getURL(org: string, repo: string, api: string): string {
let url: string = '';

if (api === 'brew') {
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;
Expand Down

0 comments on commit 30be24c

Please sign in to comment.