0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitHub Actionsの手動実行 workflow_dispatchの挙動解説

Posted at

経緯

GitHub Actionsでよく利用するイベントの一つにworkflow_dispatchがある。
自分への備忘録を兼ねて挙動を解説しておく。

  • 用意したコード
name: Greeting

on:
  workflow_dispatch:
    inputs:
      greeting:
        type: string
        description: "The greeting to use"
        required: true
        default: "Hello, world!"

jobs:
  greeting:
    runs-on: ubuntu-latest
    steps:
      - name: Greeting
        run: echo "${{ inputs.greeting }}"

実行した際に簡単な挨拶を返す。
手入力によって挨拶の内容を改変できるという最低限シンプルなものを用意した。
git add してcommitしてpush,実行して挙動を確認していく。

早速ワークフローがコンソールに追加されていることがわかる。
スクリーンショット 2025-10-26 14.21.19.png

右上の「Run workflow」をクリックすると、画像のようなモーダルが表示される。
yamlに記載した通り、文字列型で手入力を求められ、テキストボックスにはデフォルトで「Hello, world!」が入っている。
スクリーンショット 2025-10-26 14.24.36.png

内容をHello, World!→Guten tag!に改変し、「Run workflow」をクリック。
スクリーンショット 2025-10-26 14.29.53.png

無事ワークフローが実行されることが表示される。
スクリーンショット 2025-10-26 14.42.33.png

ワークフロー実行が完了した表示。クリックして内容を確認する。
スクリーンショット 2025-10-26 14.42.49.png

Guten tag!の挨拶が意図知った通りに表示されている。
検証完了。
スクリーンショット 2025-10-26 14.43.11.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?