Skip to content

Verify whether an empty environment input is valid in the Kubernetes workflow #7

Description

@iampopye

The question

.github/workflows/kubernetes/reusable-kubernetes-deploy.yml declares:

environment:
  description: GitHub environment name. Use its protection rules to gate deploys.
  required: false
  type: string
  default: ""

and the job uses environment: ${{ inputs.environment }}.

The intent is that leaving it empty means "no environment". This has not been verified. GitHub may instead treat an empty string as a request to create an environment literally named "", or reject it.

Why it matters

If an empty string is invalid, every caller who omits the input gets a confusing failure on their first run — the worst possible first impression of a workflow.

What to do

  1. Fork this repo
  2. Create a tiny caller workflow that uses the K8s workflow without passing environment
  3. Run it and observe: does the job start? Does an environment appear under Settings → Environments?
  4. Report what you saw in a comment
  5. If it is broken, fix it — the usual approach is a separate job guarded by if:, since environment cannot be conditionally omitted from a single job

Note

You do not need a real Kubernetes cluster. The job will fail at the kubeconfig step, but that is after the environment is resolved, so you will still learn what you need.

This is a genuinely useful contribution and a good way to learn how GitHub environments actually behave.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersneeds testingNeeds verification against a real project before mergeworkflow: k8sRelates to the Kubernetes deploy workflow

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions