fix(workflow run): apply url.PathEscape when compiling URL

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2026-02-16 21:55:25 +00:00
parent 3e9fbbb2fa
commit 36a85fd71f
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -7,6 +7,7 @@ import (
"fmt"
"io"
"net/http"
"net/url"
"reflect"
"sort"
"strings"
@ -319,7 +320,7 @@ func runRun(opts *RunOptions) error {
returnRunDetailsSupported = features.DispatchRunDetails
}
path := fmt.Sprintf("repos/%s/actions/workflows/%d/dispatches", ghrepo.FullName(repo), workflow.ID)
path := fmt.Sprintf("repos/%s/%s/actions/workflows/%d/dispatches", url.PathEscape(repo.RepoOwner()), url.PathEscape(repo.RepoName()), workflow.ID)
requestBody := map[string]interface{}{
"ref": ref,