mirror of
https://gitea.com/actions/release-action.git
synced 2024-11-22 10:05:39 +01:00
Merge pull request 'Fix blank line will upload all files' (#12) from lunny/ignore_blank_file_line into main
Reviewed-on: https://gitea.com/actions/release-action/pulls/12
This commit is contained in:
commit
21a5938ff2
5
main.go
5
main.go
@ -110,7 +110,10 @@ func getFiles(parentDir, files string) ([]string, error) {
|
|||||||
lines := strings.Split(files, "\n")
|
lines := strings.Split(files, "\n")
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
line = strings.Trim(line, "'")
|
line = strings.Trim(line, "'")
|
||||||
line = strings.Trim(line, `"`)
|
line = strings.TrimSpace(strings.Trim(line, `"`))
|
||||||
|
if line == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if filepath.IsAbs(line) {
|
if filepath.IsAbs(line) {
|
||||||
return nil, fmt.Errorf("file path %s is absolute", line)
|
return nil, fmt.Errorf("file path %s is absolute", line)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user