Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR の目的
GitHub Actionsワークフローを手動で実行できるようにします。
カテゴリ
PR の背景
一時的なネットワークトラブルなどの外的要因でCIの実行に失敗することがあります。
こういう時にAppVeyorやAzure Pipelinesでは手動で再実行することができますが、GitHub Actionsではできません。
幸い、2020年7月に
workflow_dispatch
イベントとして手動トリガーが実装されているので、ワークフローをこのイベントに対応させて手動実行できるようにしたいです。PR のメリット
何らかの要因でワークフローが失敗したとき、任意のタイミングで再実行できるようになります。
PR のデメリット (トレードオフとかあれば)
仕様・動作説明
workflow_dispatch
イベントに対応させます。デフォルトブランチのワークフロー設定ファイルにこのイベントへの対応があると、ワークフローの実行一覧ページに「Run workflow」ボタンが表示されて手動実行できるようになります。
なお、このイベントではパス例外は指定できません。
また、デフォルトブランチ以外は当該ブランチのワークフロー設定でイベントに対応している必要があります。
PR の影響範囲
テスト内容
PR前にこのブランチをデフォルトブランチに設定して、ボタンが表示され手動実行できることを確認済みです。
https://github.com/kazasaku/sakura/actions/runs/1801203191
https://github.com/kazasaku/sakura/actions/runs/1801203384
関連 issue, PR
#1787
参考資料
2020-07-06付: GitHub Actions: Manual triggers with workflow_dispatch | GitHub Changelog
Manually running a workflow - GitHub Docs