Revert breaking change
This commit is contained in:
parent
7cca07b699
commit
b95e6b2ae4
1 changed files with 5 additions and 9 deletions
|
|
@ -262,15 +262,11 @@ func runRun(opts *RunOptions) error {
|
|||
|
||||
ref := opts.Ref
|
||||
|
||||
defaultBranch, err := api.RepoDefaultBranch(client, repo)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to determine default branch for %s: %w", ghrepo.FullName(repo), err)
|
||||
}
|
||||
|
||||
if ref != "" && ref != defaultBranch {
|
||||
return fmt.Errorf("ref %s is not the default branch, and workflows must be on the default branch to be triggered by workflow_dispatch", ref)
|
||||
} else {
|
||||
ref = defaultBranch
|
||||
if ref == "" {
|
||||
ref, err = api.RepoDefaultBranch(client, repo)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to determine default branch for %s: %w", ghrepo.FullName(repo), err)
|
||||
}
|
||||
}
|
||||
|
||||
states := []shared.WorkflowState{shared.Active}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue