Skip to content

inputs type are undocumented / contradicting #44770

@Malix-Labs

Description

@Malix-Labs

Code of Conduct

What article on docs.github.com is affected? / What part(s) of the article would you like to see updated?

  • workflow-syntax#onworkflow_dispatchinputsinput_idtype
  • events-that-trigger-workflows#providing-inputs
    • https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#providing-inputs
    • ### Providing inputs
      You can configure custom-defined input properties, default input values, and required inputs for the event directly in your workflow. When you trigger the event, you can provide the `ref` and any `inputs`. When the workflow runs, you can access the input values in the `inputs` context. For more information, see [AUTOTITLE](/actions/learn-github-actions/contexts).
      {% data reusables.actions.inputs-vs-github-event-inputs %}
      This example defines inputs called `logLevel`, `tags`, and `environment`. You pass values for these inputs to the workflow when you run it. This workflow then prints the values to the log, using the `inputs.logLevel`, `inputs.tags`, and `inputs.environment` context properties.
      ```yaml
      on:
      workflow_dispatch:
      inputs:
      logLevel:
      description: 'Log level'
      required: true
      default: 'warning'
      type: choice
      options:
      - info
      - warning
      - debug
      tags:
      description: 'Test scenario tags'
      required: false
      type: boolean
      environment:
      description: 'Environment to run tests against'
      type: environment
      required: true
      jobs:
      log-the-inputs:
      runs-on: ubuntu-latest
      steps:
      - run: |
      echo "Log level: $LEVEL"
      echo "Tags: $TAGS"
      echo "Environment: $ENVIRONMENT"
      env:
      LEVEL: {% raw %}${{ inputs.logLevel }}{% endraw %}
      TAGS: {% raw %}${{ inputs.tags }}{% endraw %}
      ENVIRONMENT: {% raw %}${{ inputs.environment }}{% endraw %}
      ```
      If you run this workflow from a browser you must enter values for the required inputs manually before the workflow will run.
      ![Screenshot of a list of workflow runs. A dropdown menu, labeled "Run workflow" and expanded to show input fields, is outlined in dark orange.](/assets/images/help/actions/workflow-dispatch-inputs.png)
      You can also pass inputs when you run a workflow from a script, or by using {% data variables.product.prodname_cli %}. For example:
      ```shell
      gh workflow run run-tests.yml -f logLevel=warning -f tags=false -f environment=staging
      ```
      For more information, see the {% data variables.product.prodname_cli %} information in [AUTOTITLE](/actions/managing-workflow-runs/manually-running-a-workflow).
  • contexts#inputs-context

Additional information

Input types are undocumented / contradicting

Particularly "environment", which, as per the documentation, seems to be a special sub-type of choice automatically populating the enum with the names of the repository's environment, but this is just a guess from the only screenshot available in the documentation

Given this, there might also even be other types

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamtriageDo not begin working on this issue until triaged by the team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions