show error message for rerun workflow older than a month ago
This commit is contained in:
parent
a6ea8fe4ed
commit
b41b77165b
1 changed files with 3 additions and 0 deletions
|
|
@ -202,6 +202,9 @@ func rerunRun(client *api.Client, repo ghrepo.Interface, run *shared.Run, onlyFa
|
|||
if err != nil {
|
||||
var httpError api.HTTPError
|
||||
if errors.As(err, &httpError) && httpError.StatusCode == 403 {
|
||||
if httpError.Message == "Unable to retry this workflow run because it was created over a month ago" {
|
||||
return fmt.Errorf("run %d cannot be rerun; %s", run.ID, httpError.Message)
|
||||
}
|
||||
return fmt.Errorf("run %d cannot be rerun; its workflow file may be broken", run.ID)
|
||||
}
|
||||
return fmt.Errorf("failed to rerun: %w", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue