Skip to content

Commit

Permalink
fix: stop using asset for github_release (#2327)
Browse files Browse the repository at this point in the history
* fix: stop using `asset` for `github_release`

* fix: reset fields when overriding by build
  • Loading branch information
suzuki-shunsuke authored Oct 8, 2023
1 parent e65bebc commit fb0c287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 1 addition & 4 deletions pkg/config/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,7 @@ func (p *Package) renderAsset(rt *runtime.Runtime) (string, error) {
case PkgInfoTypeGitHubArchive, PkgInfoTypeGoBuild:
return "", nil
case PkgInfoTypeGoInstall:
if pkgInfo.Asset != "" {
return pkgInfo.Asset, nil
}
return path.Base(pkgInfo.GetPath()), nil
return path.Base(pkgInfo.GetFiles()[0].Name), nil
case PkgInfoTypeGitHubContent:
s, err := p.RenderTemplateString(pkgInfo.Path, rt)
if err != nil {
Expand Down
5 changes: 4 additions & 1 deletion pkg/config/registry/package_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ func (p *PackageInfo) OverrideByRuntime(rt *runtime.Runtime) { //nolint:cyclop,f
}

func (p *PackageInfo) OverrideByBuild() {
p.Type = p.Build.Type
if p.Type != p.Build.Type {
p.resetByPkgType(p.Build.Type)
p.Type = p.Build.Type
}
if p.Build.Path != "" {
p.Path = p.Build.Path
}
Expand Down

0 comments on commit fb0c287

Please sign in to comment.