diff --git a/package.json b/package.json index e9f04124..9633b2da 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ }, "dependencies": { "@actions/core": "1.10.1", - "@actions/exec": "1.1.1" + "@actions/exec": "1.1.1", + "lodash": "^4.17.21" }, "devDependencies": { "@commitlint/cli": "19.5.0", diff --git a/src/input.ts b/src/input.ts index 3b8c8791..5f837608 100644 --- a/src/input.ts +++ b/src/input.ts @@ -1,5 +1,6 @@ import * as core from '@actions/core'; import path from 'path'; +import _ from 'lodash'; interface EnvironmentVariable { key: string; @@ -29,7 +30,7 @@ class Input { constructor() { const envRegexInput = core.getInput('env-regex'); const envRegex = envRegexInput - ? new RegExp(envRegexInput) + ? new RegExp(_.escapeRegExp(envRegexInput)) : this.options.envRegex; this._environmentVariables = new Map( Object.entries(process.env)