From b41b77165bc8d0d6cdf7a031c62d2e09c3160aa7 Mon Sep 17 00:00:00 2001 From: Rajhans Jadhao Date: Mon, 13 Jan 2025 19:21:58 +0530 Subject: [PATCH] show error message for rerun workflow older than a month ago --- pkg/cmd/run/rerun/rerun.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/run/rerun/rerun.go b/pkg/cmd/run/rerun/rerun.go index 1c7d6b53f..20e94b68f 100644 --- a/pkg/cmd/run/rerun/rerun.go +++ b/pkg/cmd/run/rerun/rerun.go @@ -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)