nektos/act · error

Unknown Function Call %s

Error message

Unknown Function Call %s

What it means

Validation error from checkSingleExpression in pkg/schema/schema.go: the expression calls a function whose name does not case-insensitively match any entry in the local function table returned by Node.GetFunctions(). The table only covers a subset of GitHub's expression functions, so a valid GitHub function missing from the table is reported as unknown.

Source

Thrown at pkg/schema/schema.go:153

	}

	funcs := s.GetFunctions()

	var err error
	actionlint.VisitExprNode(exprNode, func(node, _ actionlint.ExprNode, entering bool) {
		if funcCallNode, ok := node.(*actionlint.FuncCallNode); entering && ok {
			for _, v := range *funcs {
				if strings.EqualFold(funcCallNode.Callee, v.name) {
					if v.min > len(funcCallNode.Args) {
						err = errors.Join(err, fmt.Errorf("Missing parameters for %s expected >= %v got %v", funcCallNode.Callee, v.min, len(funcCallNode.Args)))
					}
					if v.max < len(funcCallNode.Args) {
						err = errors.Join(err, fmt.Errorf("Too many parameters for %s expected <= %v got %v", funcCallNode.Callee, v.max, len(funcCallNode.Args)))
					}
					return
				}
			}
			err = errors.Join(err, fmt.Errorf("Unknown Function Call %s", funcCallNode.Callee))
		}
		if varNode, ok := node.(*actionlint.VariableNode); entering && ok {
			for _, v := range s.Context {
				if strings.EqualFold(varNode.Name, v) {
					return
				}
			}
			err = errors.Join(err, fmt.Errorf("Unknown Variable Access %s", varNode.Name))
		}
	})
	return err
}

func (s *Node) GetFunctions() *[]FunctionInfo {
	funcs := &[]FunctionInfo{}
	AddFunction(funcs, "contains", 2, 2)
	AddFunction(funcs, "endsWith", 2, 2)
	AddFunction(funcs, "format", 1, 255)

View on GitHub (pinned to 4f41128141)

Solutions

  1. Fix the function name spelling to a registered one (see GetFunctions in schema.go)
  2. If the function genuinely exists on GitHub Actions but is missing from act's table, open an issue or add it via AddFunction in a fork
  3. Replace the unsupported call with an equivalent registered function or move logic into the run step (shell)

Example fix

# before:
if: ${{ hashFile('**/go.sum') }}
# after:
if: ${{ hashFiles('**/go.sum') }}
Defensive patterns

Strategy: validation

Validate before calling

// Cross-check every function name against act's registered list:
// contains, endsWith, format, join, startsWith, toJSON, fromJSON, hashFiles (see GetFunctions)

Try / catch

Fatal validation error; correct the function name or add it to the schema table in a fork.

Prevention

When it happens

Trigger: Any ${{ someFunc(...) }} where someFunc is not in the AddFunction list (contains, endsWith, format, join, startsWith, toJSON, fromJSON, hashFiles, etc. as registered). Also plain typos like ${{ tojson(...) }} only pass if the table registers that spelling.

Common situations: Typos in function names (toLower vs toLower correct spelling, hashFile vs hashFiles); using a newer GitHub function not yet in act's table; case variations that the table doesn't cover.

Related errors


AI-assisted analysis of nektos/act@4f41128141 (2026-08-15). Data as JSON: /api/errors/78e7d4e9378c4617. Report an issue: GitHub.