From fb10789c786244716c150dc5fc9e313688537956 Mon Sep 17 00:00:00 2001 From: David Leek Date: Mon, 12 Feb 2024 08:07:06 +0100 Subject: [PATCH] chore: remove environment parameter --- action.yml | 5 ----- src/index.ts | 2 -- src/unleash-action.ts | 2 -- test/unleash-action.test.js | 6 ------ 4 files changed, 15 deletions(-) diff --git a/action.yml b/action.yml index 6532b5e..dc55169 100644 --- a/action.yml +++ b/action.yml @@ -13,11 +13,6 @@ inputs: description: 'URL to Unleash Edge or frontend API' type: 'string' required: true - environment: - description: 'The environment for which to evaluate the feature flags' - type: 'string' - required: false - default: 'default' is-enabled: description: 'Newline-separated list of feature flag names to evaluate' type: 'string' diff --git a/src/index.ts b/src/index.ts index 6d6c6a0..e2715f1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,6 @@ import { getInput, getMultilineInput, setOutput } from '@actions/core'; const appName = getInput('app-name'); const url = getInput('url'); const clientKey = getInput('api-key'); -const environment = getInput('environment'); const context: Record = {}; const contextLines = getMultilineInput('context'); @@ -20,7 +19,6 @@ createUnleashAction({ url: url, clientKey: clientKey, appName: appName, - environment: environment, context: context, features: features, variants: variants, diff --git a/src/unleash-action.ts b/src/unleash-action.ts index 4c48b24..e5c2104 100644 --- a/src/unleash-action.ts +++ b/src/unleash-action.ts @@ -5,7 +5,6 @@ interface ICreateUnleashActionOptions { url: string; clientKey: string; appName: string; - environment: string; context: Record; features?: string[]; variants?: string[]; @@ -41,7 +40,6 @@ const createClient = (options: ICreateUnleashActionOptions): UnleashClient => { appName: options.appName, url: options.url, clientKey: options.clientKey, - environment: options.environment, refreshInterval: 0, metricsInterval: 0, disableMetrics: true, diff --git a/test/unleash-action.test.js b/test/unleash-action.test.js index 3088117..f856171 100644 --- a/test/unleash-action.test.js +++ b/test/unleash-action.test.js @@ -23,7 +23,6 @@ test('checks features', async () => { url: 'http://localhost:3000', clientKey: 'client-1', appName: 'test-app', - environment: 'test', context: {}, features: ['feature-1'], setResult: (name, value) => { @@ -63,7 +62,6 @@ test('checks variants', async () => { url: 'http://localhost:3000', clientKey: 'client-1', appName: 'test-app', - environment: 'test', context: {}, variants: ['variant-1'], setResult: (name, value) => { @@ -94,7 +92,6 @@ test('end calls sendMetrics and stop', async () => { url: 'http://localhost:3000', clientKey: 'client-1', appName: 'test-app', - environment: 'test', context: {}, variants: ['variant-1'], setResult: () => {}, @@ -131,7 +128,6 @@ test('counts features and variants', async () => { url: 'http://localhost:3000', clientKey: 'client-1', appName: 'test-app', - environment: 'test', context: {}, features: ['feature-1', 'feature-2'], variants: ['variant-1'], @@ -169,7 +165,6 @@ test('doesnt set variant result if variant is not enabled', async () => { url: 'http://localhost:3000', clientKey: 'client-1', appName: 'test-app', - environment: 'test', context: {}, variants: ['variant-1'], setResult, @@ -208,7 +203,6 @@ test('sets feature result to false if feature is not enabled', async () => { url: 'http://localhost:3000', clientKey: 'client-1', appName: 'test-app', - environment: 'test', context: {}, features: ['feature-1'], setResult,