GitHub Actions Job failed due to missing input

A required input for the job is not provided.

Understanding GitHub Actions

GitHub Actions is a powerful CI/CD tool integrated directly into GitHub, allowing developers to automate their workflows, from code testing to deployment. It provides a flexible way to build, test, and deploy applications directly from a GitHub repository.

Identifying the Symptom

One common issue developers encounter is a job failure due to missing input. This typically manifests as an error message indicating that a required input for the job is not provided. This can halt the workflow execution and prevent the job from completing successfully.

Example Error Message

When this issue occurs, you might see an error message like:

Error: Input required and not supplied: <input_name>

Exploring the Issue

The root cause of this problem is often a missing input parameter that the workflow expects to be provided. Inputs are defined in the workflow YAML file and are essential for the job's execution. If these inputs are not supplied, either through the workflow file or at runtime, the job will fail.

Common Causes

  • Inputs not defined in the workflow YAML file.
  • Inputs defined but not provided at runtime.
  • Typographical errors in input names.

Steps to Fix the Issue

To resolve this issue, follow these steps:

1. Verify Workflow YAML

Check the workflow YAML file to ensure that all required inputs are defined correctly. Inputs are typically defined under the jobs section. For example:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run script
uses: actions/setup-node@v2
with:
node-version: '14'
input_name: ${{ inputs.input_name }}

2. Provide Inputs at Runtime

If the inputs are defined but not provided, ensure they are supplied when triggering the workflow. This can be done through the GitHub Actions UI or via the command line. For example, when using the GitHub CLI:

gh workflow run <workflow_name> --field input_name=value

3. Check for Typographical Errors

Ensure there are no typographical errors in the input names. The input names in the workflow file must match exactly with those provided at runtime.

Additional Resources

For more information on GitHub Actions and managing inputs, consider visiting the following resources:

Master

GitHub Actions

in Minutes — Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

GitHub Actions

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid