GitHub Actionsのworkflow_dispatchでさまざまな入力タイプを利用する

GitHub Actionsを手動で実行する workflow_dispatch にはさまざなま入力を指定できる。 input のcontextには string or number or boolean or choice とあり、例としてstring, number, booleanの場合が記載されている。

docs.github.com

実は、 on.workflow_dispatch.inputs のドキュメントにはもう少し詳しい(正確?)なドキュメントがあり、上記には記載されていないchoiceの記述方法や紹介されていないenvironmentが利用可能なことが示されている。

docs.github.com

on:
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'
        required: true
        default: 'warning'
        type: choice
        options:
          - info
          - warning
          - debug
      print_tags:
        description: 'True to print to STDOUT'
        required: true
        type: boolean
      tags:
        description: 'Test scenario tags'
        required: true
        type: string
      environment:
        description: 'Environment to run tests against'
        type: environment
        required: true

このように、type: choiceを指定した場合はoptionsの項目に選択肢を指定する。 type: environmentを指定した場合は各リポジトリに設定したenvironmentが選択できる。