Skip to content

Commit 31f3756

Browse files
committed
fix(workflow run): bail out on feature detection error
Signed-off-by: Babak K. Shandiz <babakks@github.com>
1 parent 52eca96 commit 31f3756

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

pkg/cmd/workflow/run/run.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,9 @@ func runRun(opts *RunOptions) error {
314314
}
315315
}
316316

317-
var returnRunDetailsSupported bool
318-
if features, err := opts.Detector.ActionsFeatures(); err == nil {
319-
// If there's an error detecting features, we assume the feature is not supported.
320-
returnRunDetailsSupported = features.DispatchRunDetails
317+
features, err := opts.Detector.ActionsFeatures()
318+
if err != nil {
319+
return err
321320
}
322321

323322
path := fmt.Sprintf("repos/%s/%s/actions/workflows/%d/dispatches", url.PathEscape(repo.RepoOwner()), url.PathEscape(repo.RepoName()), workflow.ID)
@@ -331,7 +330,7 @@ func runRun(opts *RunOptions) error {
331330
// We will have to always set the `return_run_details` field to true, unless
332331
// we opt into the the new REST API version, which will probably return the
333332
// details by default.
334-
if returnRunDetailsSupported {
333+
if features.DispatchRunDetails {
335334
requestBody["return_run_details"] = true
336335
}
337336

0 commit comments

Comments
 (0)