ショートカットアプリで楽々GitHub Actionsワークフローディスパッチ
6068 ワード
ショートカットアプリでなんか面白いことできないかなと見てたら、GitHubの公式アプリに
あったわ。
Workflow ID
Workflow IDというものが必要なようなのでActions - GitHub Docsを参考にして取得する。
❯ curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/KoheiKanagu/KoheiKanagu/actions/workflows
{
"total_count": 2,
"workflows": [
{
"id": 10719756,
"node_id": "MDg6V29ya2Zsb3cxMDcxOTc1Ng==",
"name": "GitHub-Profile-3D-Contrib",
"path": ".github/workflows/profile-3d.yml",
"state": "active",
"created_at": "2021-06-24T07:47:01.000Z",
"updated_at": "2021-06-24T07:47:01.000Z",
"url": "https://api.github.com/repos/KoheiKanagu/KoheiKanagu/actions/workflows/10719756",
"html_url": "https://github.com/KoheiKanagu/KoheiKanagu/blob/master/.github/workflows/profile-3d.yml",
"badge_url": "https://github.com/KoheiKanagu/KoheiKanagu/workflows/GitHub-Profile-3D-Contrib/badge.svg"
},
{
"id": 2478894,
"node_id": "MDg6V29ya2Zsb3cyNDc4ODk0",
"name": "GitHub-Profile-Summary-Cards",
"path": ".github/workflows/profile-summray-cards.yml",
"state": "active",
"created_at": "2020-09-08T02:46:13.000Z",
"updated_at": "2020-09-08T02:46:13.000Z",
"url": "https://api.github.com/repos/KoheiKanagu/KoheiKanagu/actions/workflows/2478894",
"html_url": "https://github.com/KoheiKanagu/KoheiKanagu/blob/master/.github/workflows/profile-summray-cards.yml",
"badge_url": "https://github.com/KoheiKanagu/KoheiKanagu/workflows/GitHub-Profile-Summary-Cards/badge.svg"
}
]
}
あるいはGitHub CLIでも取得できる。
プライベートリポジトリの場合はcurlだと認証トークン云々が必要なはずなのでこっちの方が簡単。
❯ gh workflow list
GitHub-Profile-3D-Contrib active 10719756
GitHub-Profile-Summary-Cards active 2478894
いざ実行
初めて実行するときは許可を求められる。
走ってます
まとめ
結局はREST APIを叩けばできることだが、ショートカットから実行できるのでiPhone、iPadがあればどこででもディスパッチできる。
ついでに 「Hey Siri、アプリビルドしといて」 とかもできるので夢が広がる。
Author And Source
この問題について(ショートカットアプリで楽々GitHub Actionsワークフローディスパッチ), 我々は、より多くの情報をここで見つけました https://zenn.dev/kingu/articles/9516444e5f83fc著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Collection and Share based on the CC protocol