我通过使用“gh”CLI 工具并阅读 REST API docs 设法解决了这个问题(目前无法通过 UI)。
首先,获取所有工作流程(这些工作流程显示在 Web UI -> 操作 -> 左栏中):
$ gh api repos/$YOUR_USER/$YOUR_REPO/actions/workflows
{
"total_count": 2,
"workflows": [
{
"id": 3611607,
"name": "FreeBSD",
...
},
{
"id": 4336318,
"name": "MacOS",
...
}
]
}
使用您要删除的工作流的 ID(例如 3611607)获取其所有单独的运行:
$ gh api repos/$YOUR_USER/$YOUR_REPO/actions/workflows/3611607/runs
{
"total_count": 17,
"workflow_runs": [
{
"id": 363876785,
"name": "FreeBSD",
...
},
{
"id": 363876786,
"name": "FreeBSD",
...
},
{
"id": 363876787,
"name": "FreeBSD",
...
},
}
对于每个运行 ID(比如 363876785),使用以下命令将其删除:
$ gh api repos/$YOUR_USER/$YOUR_REPO/actions/runs/363876785 -X DELETE
之后,Web UI 左栏中不可删除的 Action 应该会消失。