`Invalid input, environment is not defined in the referenced workflow.` when calling a reusable workflow
IntermediateTroubleshootingWorkflows Not Triggering & Invalid Files
Answer
Likely causes → The caller passes with: environment: dev but the called workflow's workflow_call.inputs does not declare environment, or names differ in case or spelling (env vs environment). Same pattern for secrets not declared.
Diagnose →
yq '.on.workflow_call.inputs | keys' .github/workflows/deploy.yml
Fix → Declare every input and secret the caller passes, or stop passing it.
Prevent → Treat workflow_call inputs as an API and document them in the file header.
More on Workflows Not Triggering & Invalid Files
You pushed a new workflow file and nothing appears in the Actions tab.Beginner`Invalid workflow file: .github/workflows/ci.yml#L14 You have an error in your yaml syntax on line 14`Beginner`The workflow is not valid. .github/workflows/ci.yml (Line: 9, Col: 5): Unexpected value 'steps'`BeginnerThe workflow runs on push to `main` but never on pull requests.BeginnerThe "Run workflow" button for `workflow_dispatch` does not appear.BeginnerA scheduled workflow stopped running weeks ago, no errors.Beginner