ワークフローディスパッチAPIが実行IDを返すようになりました
本文の状態
日本語全文を表示中
詳細モードで約2分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
GitHub Changelog
GitHub ActionsのワークフローディスパッチAPIでワークフローをトリガーすると、レスポンスに実行IDなどのメタデータが含まれるようになり、リクエストの追跡が容易になります。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
GitHub ActionsのワークフローをAPI経由で起動する際、新たに実行IDなどのメタデータを応答として取得できるようになりました。これまでは、ワークフロー・ディスパッチAPIエンドポイントを使用してワークフローをトリガーすると、応答は「204 No Content」ステータスコードのみで、実際に開始されたワークフローの実行をAPI呼び出しと直接関連付けることが困難でした。
今回の変更により、API呼び出し時に新しいオプションパラメータ「return_run_details」をtrueに設定すると、応答ステータスが「200 OK」に変わり、ワークフローの実行ID、API URL、ワークフローのWeb URLを含む詳細情報が返されます。このパラメータを指定しない場合、従来通り「204 No Content」が返るため、既存の実装は影響を受けません。
この機能はGitHub CLI(バージョン2.87.0以降)でもサポートされています。「gh workflow run」コマンドでワークフローを起動すると、作成された実行のURLと、その実行を確認するための「gh run view」コマンドが自動的に表示されるようになりました。
この改善により、開発者は自身のAPI呼び出しによって開始されたワークフロー実行を容易に追跡できるようになります。これまで必要だった、大量のポーリング処理や独自の追跡システムの構築が不要となり、自動化スクリプトやCI/CDパイプラインとの連携が大幅に効率化されます。なお、最新版のGitHub CLIでは、「return_run_details」パラメータがデフォルトで有効(true)に設定されています。
要約すると、ワークフロー・ディスパッチAPIの応答に実行詳細情報を含めるオプションが追加されたことで、ワークフロー実行の可観測性と管理性が向上し、開発者体験が改善された点が主なポイントです。詳細はGitHub Actionsの公式ドキュメントで確認できます。
原文を表示
Workflow dispatch API now returns run IDs - GitHub Changelog Back to changelog When you trigger a workflow using the GitHub Actions workflow dispatch API endpoint, you’ll now have the option to receive metadata in the response that helps you map your request to the corresponding workflow run. Previously, this endpoint returned only a 204 No Content status code. Now, you can pass in a new optional boolean parameter, return_run_details, which will return a 200 OK response containing the workflow ID, API URL, and workflow URL. If you do not pass in this parameter, it will continue to return the current 204 No Content status code.
This capability is also supported within the GitHub CLI, as of v2.87.0. If you trigger a workflow dispatch via gh workflow run, GitHub CLI will now return the URL for the created run along with the gh run view command for viewing that run.
With this update, developers can easily identify which workflow runs originated from their API calls—no more extensive polling or building custom tracking solutions. This new parameter is currently available in the API, and the newest version of the GitHub CLI will also default return_run_details to true.
Learn more about the workflow dispatch API in the GitHub Actions documentation.
Subscribe to our developer newsletter
Discover tips, technical guides, and best practices in our biweekly newsletter just for devs.
By submitting, I agree to let GitHub and its affiliates use my information for personalized communications, targeted advertising, and campaign effectiveness. See the GitHub Privacy Statement for more details.
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み