{"record":{"id":"d8abaed65f432880","repo":"nektos/act","slug":"invalid-format-v-expected-a-line-with-or","errorCode":null,"errorMessage":"invalid format '%v', expected a line with '=' or '<<'","messagePattern":"invalid format '(.+?)', expected a line with '=' or '<<'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/container/parse_env_file.go","lineNumber":63,"sourceCode":"\t\t\t\tmultiLineEnvDelimiter := line[multiLineEnv+2:]\n\t\t\t\tdelimiterFound := false\n\t\t\t\tfor s.Scan() {\n\t\t\t\t\tcontent := s.Text()\n\t\t\t\t\tif content == multiLineEnvDelimiter {\n\t\t\t\t\t\tdelimiterFound = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tif multiLineEnvContent != \"\" {\n\t\t\t\t\t\tmultiLineEnvContent += \"\\n\"\n\t\t\t\t\t}\n\t\t\t\t\tmultiLineEnvContent += content\n\t\t\t\t}\n\t\t\t\tif !delimiterFound {\n\t\t\t\t\treturn fmt.Errorf(\"invalid format delimiter '%v' not found before end of file\", multiLineEnvDelimiter)\n\t\t\t\t}\n\t\t\t\tlocalEnv[line[:multiLineEnv]] = multiLineEnvContent\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"invalid format '%v', expected a line with '=' or '<<'\", line)\n\t\t\t}\n\t\t}\n\t\tenv = &localEnv\n\t\treturn s.Err()\n\t}\n}\n","sourceCodeStart":45,"sourceCodeEnd":70,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/container/parse_env_file.go#L45-L70","documentation":"Thrown by the .env file parser when a line contains neither '=' (key=value) nor act's heredoc marker '<<'. Every non-comment line in an env file must be KEY=VALUE or KEY<<DELIM; anything else is rejected.","triggerScenarios":"Passing --env-file a shell script (with export statements, quotes only, or bare words); stray lines like 'set -e', continuation lines, or prose in the env file.","commonSituations":"Reusing a shell env script as act env file; files with BOM or Windows artifacts; typo like 'KEY =value' handled elsewhere but a truly malformed line 'KEY value' hits this.","solutions":["Convert 'export KEY=value' lines to plain 'KEY=value'.","Remove shell syntax (set, comments without #, blank commands) from the env file.","Prefix comment lines with # so the parser skips them.","Run a quick lint: awk -F= 'NF<2 && $0!~/^#/' file to find offending lines."],"exampleFix":"# before (.env)\nexport DEBUG=1\nset -e\n# after (.env)\nDEBUG=1","handlingStrategy":"validation","validationCode":"func lintEnvFile(path string) error {\n  f, _ := os.Open(path)\n  defer f.Close()\n  s := bufio.NewScanner(f)\n  for s.Scan() {\n    l := s.Text()\n    if l == '' || strings.HasPrefix(l, '#') { continue }\n    if !strings.Contains(l, '=') && !strings.Contains(l, '<<') {\n      return fmt.Errorf('malformed env line: %q', l)\n    }\n  }\n  return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never put shell syntax (export, set) in act env files","Generate env files programmatically rather than reusing shell scripts","Prefix comments with # only"],"tags":["env-file","parsing","configuration","shell-syntax"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}