From 38a34c1c26054b4a8d734f418164ed037e51fe9a Mon Sep 17 00:00:00 2001 From: Josh Gross Date: Wed, 13 Nov 2019 10:27:25 -0500 Subject: [PATCH] Linting --- __tests__/restore.test.ts | 2 +- src/constants.ts | 8 ++++---- src/utils/actionUtils.ts | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/__tests__/restore.test.ts b/__tests__/restore.test.ts index 88f9fdd..191f804 100644 --- a/__tests__/restore.test.ts +++ b/__tests__/restore.test.ts @@ -302,7 +302,7 @@ test("restore with a pull request event and cache found", async () => { archiveLocation: "https://www.example.com/download" }; const getCacheMock = jest.spyOn(cacheHttpClient, "getCacheEntry"); - getCacheMock.mockImplementation(_ => { + getCacheMock.mockImplementation(() => { return Promise.resolve(cacheEntry); }); const tempPath = "/foo/bar"; diff --git a/src/constants.ts b/src/constants.ts index 0959dbb..5f26e8c 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -13,8 +13,8 @@ export enum State { CacheResult = "CACHE_RESULT" } -export namespace Events { - export const Key = "GITHUB_EVENT_NAME"; - export const Push = "push"; - export const PullRequest = "pull_request"; +export enum Events { + Key = "GITHUB_EVENT_NAME", + Push = "push", + PullRequest = "pull_request" } diff --git a/src/utils/actionUtils.ts b/src/utils/actionUtils.ts index 556e1d2..15b73fd 100644 --- a/src/utils/actionUtils.ts +++ b/src/utils/actionUtils.ts @@ -85,6 +85,10 @@ export function resolvePath(filePath: string): string { return path.resolve(filePath); } +export function getSupportedEvents(): string[] { + return [Events.Push, Events.PullRequest]; +} + // Currently the cache token is only authorized for push and pull_request events // All other events will fail when reading and saving the cache // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context @@ -92,7 +96,3 @@ export function isValidEvent(): boolean { const githubEvent = process.env[Events.Key] || ""; return getSupportedEvents().includes(githubEvent); } - -export function getSupportedEvents(): string[] { - return [Events.Push, Events.PullRequest]; -}