{"record":{"id":"d203b90d5f876be6","repo":"nektos/act","slug":"unknown-variable-access-s","errorCode":null,"errorMessage":"Unknown Variable Access %s","messagePattern":"Unknown Variable Access (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/schema/schema.go","lineNumber":161,"sourceCode":"\t\t\t\tif strings.EqualFold(funcCallNode.Callee, v.name) {\n\t\t\t\t\tif v.min > len(funcCallNode.Args) {\n\t\t\t\t\t\terr = errors.Join(err, fmt.Errorf(\"Missing parameters for %s expected >= %v got %v\", funcCallNode.Callee, v.min, len(funcCallNode.Args)))\n\t\t\t\t\t}\n\t\t\t\t\tif v.max < len(funcCallNode.Args) {\n\t\t\t\t\t\terr = errors.Join(err, fmt.Errorf(\"Too many parameters for %s expected <= %v got %v\", funcCallNode.Callee, v.max, len(funcCallNode.Args)))\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\terr = errors.Join(err, fmt.Errorf(\"Unknown Function Call %s\", funcCallNode.Callee))\n\t\t}\n\t\tif varNode, ok := node.(*actionlint.VariableNode); entering && ok {\n\t\t\tfor _, v := range s.Context {\n\t\t\t\tif strings.EqualFold(varNode.Name, v) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\terr = errors.Join(err, fmt.Errorf(\"Unknown Variable Access %s\", varNode.Name))\n\t\t}\n\t})\n\treturn err\n}\n\nfunc (s *Node) GetFunctions() *[]FunctionInfo {\n\tfuncs := &[]FunctionInfo{}\n\tAddFunction(funcs, \"contains\", 2, 2)\n\tAddFunction(funcs, \"endsWith\", 2, 2)\n\tAddFunction(funcs, \"format\", 1, 255)\n\tAddFunction(funcs, \"join\", 1, 2)\n\tAddFunction(funcs, \"startsWith\", 2, 2)\n\tAddFunction(funcs, \"toJson\", 1, 1)\n\tAddFunction(funcs, \"fromJson\", 1, 1)\n\tfor _, v := range s.Context {\n\t\ti := strings.Index(v, \"(\")\n\t\tif i == -1 {\n\t\t\tcontinue","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/schema/schema.go#L143-L179","documentation":"Validation error from checkSingleExpression in pkg/schema/schema.go: the expression references a context variable (e.g. github, env, matrix) that is not in the current Node's Context list. Each schema node declares which top-level context variables are allowed; accessing anything else is rejected.","triggerScenarios":"${{ secrets.MY_TOKEN }} in a node whose Context only contains ['github', 'env'], or ${{ matrix.foo }} where matrix is not declared for that node (e.g. in a reusable-workflow-level field).","commonSituations":"Using secrets in places GitHub does not allow (e.g. run-name or keys without secrets context); referencing matrix/job/runner context in top-level workflow fields; assuming all contexts are available everywhere.","solutions":["Move the expression to a field that allows the context (job-level env, step env, step if)","Pass the value through an env var from an allowed location: env: { TOKEN: ${{ secrets.MY_TOKEN }} }","Check the schema definition's Context array for the node to see which variables are permitted"],"exampleFix":"# before (context not allowed at this node):\nrun-name: deploy-${{ secrets.ENV_NAME }}\n# after:\nenv:\n  ENV_NAME: ${{ secrets.ENV_NAME }}\nrun-name: deploy-${{ env.ENV_NAME }}","handlingStrategy":"validation","validationCode":"# Only reference context variables the node declares:\n# allowed commonly: github, env, matrix (job), secrets (job/step), vars, inputs\n# avoid secrets/vars in top-level fields like run-name or mapping keys","typeGuard":null,"tryCatchPattern":"Validation failure — move the reference to a permitted field and re-validate.","preventionTips":["Pipe secrets through job/step env instead of structural fields","Check available contexts per field in the GitHub workflow docs","Validate workflows in CI with act's schema check"],"tags":["go","act","schema-validation","expressions","context-variables"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}