nektos/act · error

Too many parameters for %s expected <= %v got %v

Error message

Too many parameters for %s expected <= %v got %v

What it means

Validation error from checkSingleExpression in pkg/schema/schema.go when a function call in a ${{ }} expression passes more arguments than the function's declared maximum arity (e.g. contains max 2, join max 2, toJSON max 1).

Source

Thrown at pkg/schema/schema.go:148

		case actionlint.TokenKindString:
			return nil
		default:
			return fmt.Errorf("expressions are not allowed here")
		}
	}

	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
}

View on GitHub (pinned to 4f41128141)

Solutions

  1. Remove the extra argument(s) to fit the max arity in the GetFunctions table
  2. Split the logic into nested calls, e.g. contains(a,b) && contains(a,c) instead of a 3-arg contains
  3. Run schema validation / actionlint locally to catch arity errors pre-commit

Example fix

# before:
if: ${{ contains(github.event.head_commit.message, 'wip', 'draft') }}
# after:
if: ${{ contains(github.event.head_commit.message, 'wip') || contains(github.event.head_commit.message, 'draft') }}
Defensive patterns

Strategy: validation

Validate before calling

// Same arity table as error 182: assert len(args) <= max for every function call in your expressions

Try / catch

Deterministic validation failure — fix and re-run; do not catch-and-continue.

Prevention

When it happens

Trigger: Calling a known function with extra args: ${{ contains(a, b, c) }}, ${{ join(array, ',', 'x') }}. The check fires when v.max < len(funcCallNode.Args).

Common situations: Assuming variadic behavior where none exists (e.g. chaining format-like args into contains); porting shell-script idioms into expressions; copy-paste adding separators to join.

Related errors


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