Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Frameworks to the Functions Framework contract.
| `-builder-runtime` | string | `""` | Runtime to use in building. Required if `-buildpacks=true`. |
| `-builder-tag` | string | `"latest"` | Builder image tag to use in building. |
| `-start-delay` | uint | `1` | Seconds to wait before sending HTTP request to command process. |
| `-envs` | string | `""` | A comma separated string of additional runtime environment variables. |

</nobr>

Expand Down
3 changes: 3 additions & 0 deletions action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ inputs:
workingDirectory:
description: 'The subdirectory in which the conformance tests should run'
default: ""
runtimeEnvs:
description: 'A comma separated list of runtime environment variable overrides'
default: ""
runs:
using: 'node12'
main: 'dist/index.js'
2 changes: 2 additions & 0 deletions action/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion action/dist/index.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async function run() {
const cmd = core.getInput('cmd');
const startDelay = core.getInput('startDelay');
const workingDirectory = core.getInput('workingDirectory');
const runtimeEnvs = core.getInput('runtimeEnvs');

let cwd = process.cwd();

Expand Down Expand Up @@ -67,6 +68,7 @@ async function run() {
`-buildpacks=${useBuildpacks}`,
`-cmd=${cmd}`,
`-start-delay=${startDelay}`,
`-envs=${runtimeEnvs}`,
].filter((x) => !!x).join(' '));
}

Expand Down
6 changes: 5 additions & 1 deletion client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func main() {
*declarativeSignature = *functionSignature
}

// Set runtime env vars that reflect https://cloud.google.com/functions/docs/configuring/env-var
validationRuntimeEnv := []string{"FUNCTION_SIGNATURE_TYPE=" + *functionSignature}
validationRuntimeEnv = append(validationRuntimeEnv, strings.Split(*envs, ",")...)

v := newValidator(validatorParams{
validateMapping: *validateMapping,
useBuildpacks: *useBuildpacks,
Expand All @@ -64,7 +68,7 @@ func main() {
declarativeSignature: *declarativeSignature,
tag: *tag,
validateConcurrency: *validateConcurrencyFlag,
envs: strings.Split(*envs, ","),
envs: validationRuntimeEnv,
})

if err := v.runValidation(); err != nil {
Expand Down