feat: explain refusals to delete or rerun an unfinished run

Gitea refuses to delete or rerun a run that has not finished with "this
workflow run is not done". Report "run 37 has not finished; cancel it first:
tea run cancel 37", and cover the next steps added to refusals in tests.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-11 22:48:50 +02:00
1 parent 6fe72cdfd1
commit dc43272085
4 files changed
+32

No files matched your search

+4
View File
@@ -186,6 +186,10 @@ func conflictHint(ctx context.Context, apiErr *transport.APIError, conflict *ser
if conflict.Key != "" {
return "enable it with: tea workflow enable " + conflict.Key
}
case services.ReasonNotDone:
if conflict.Kind == "run" && conflict.Key != "" {
return "cancel it first: tea run cancel " + conflict.Key
}
case services.ReasonOwnsRepos:
return "transfer or delete them first"
}