feat: allow override env regex (#692)

This commit is contained in:
Emil Davtyan 2023-02-13 07:44:09 +01:00 committed by GitHub
parent 5f40203468
commit 62d65f0924
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 1 deletions

View file

@ -26,9 +26,11 @@ class Input {
private readonly _configurationFile: Readonly<EnvironmentVariable>;
constructor() {
const envRegexInput = core.getInput('env-regex');
const envRegex = envRegexInput ? new RegExp(envRegexInput) : this.options.envRegex;
this._environmentVariables = new Map(
Object.entries(process.env).filter(([key]) =>
this.options.envRegex.test(key)
envRegex.test(key)
)
);