Skip to main content

require-workflow-call-input-type

Rule catalog ID: R034

Targeted pattern scopeโ€‹

GitHub Actions workflow YAML files that define on.workflow_call.inputs for reusable workflows.

What this rule reportsโ€‹

This rule reports reusable workflow inputs that omit type or set type to a value outside GitHub's documented string, number, and boolean reusable-workflow input types.

Why this rule existsโ€‹

Reusable workflows are interfaces consumed by other workflows. Explicitly typed inputs make those interfaces clearer for callers, help GitHub validate passed values consistently, and reduce ambiguity when workflows evolve.

โŒ Incorrectโ€‹

on:
workflow_call:
inputs:
dry_run:
description: Run validation only
required: false

โœ… Correctโ€‹

on:
workflow_call:
inputs:
dry_run:
description: Run validation only
required: false
type: boolean

Additional examplesโ€‹

For larger repositories, this rule is often enabled together with one of the published presets so violations are caught in pull requests before workflow changes are merged.

ESLint flat config exampleโ€‹

import githubActions from "eslint-plugin-github-actions-2";

export default [
{
files: ["**/*.{yml,yaml}"],
plugins: {
"github-actions": githubActions,
},
rules: {
"github-actions/require-workflow-call-input-type": "error",
},
},
];

When not to use itโ€‹

You can disable this rule when its policy does not match your repository standards, or when equivalent enforcement is already handled by another policy tool.

Further readingโ€‹