Skip to content

Commit 25716ef

Browse files
fix localPath when run in github actions
1 parent e1bb1bc commit 25716ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/upload.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ func getToolShortName(fullName string) string {
7171
func getRelativePath(baseDir string, fullURI string) string {
7272

7373
localPath := fullURI
74+
// GitHub Actions workaround
75+
if strings.Contains(baseDir, "/home/runner/work/") {
76+
localPath = filepath.Join(baseDir, fullURI)
77+
}
7478
u, err := url.Parse(fullURI)
7579
if err == nil && u.Scheme == "file" {
7680
// url.Path extracts the local path component correctly
7781
localPath = u.Path
7882
}
83+
7984
relativePath, err := filepath.Rel(baseDir, localPath)
8085
if err != nil {
8186
// Fallback to the normalized absolute path if calculation fails

0 commit comments

Comments
 (0)