mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 17:50:12 +00:00
fix(agentcompat): root workflow file reads
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -3,6 +3,7 @@ package workflowpolicy
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -25,7 +26,12 @@ func Verify(data []byte, repository Repository) error {
|
||||
}
|
||||
|
||||
func VerifyFile(path string, repository Repository) error {
|
||||
data, err := os.ReadFile(path)
|
||||
root, err := os.OpenRoot(filepath.Dir(path))
|
||||
if err != nil {
|
||||
return &ReadError{Path: path, Cause: err}
|
||||
}
|
||||
defer root.Close()
|
||||
data, err := root.ReadFile(filepath.Base(path))
|
||||
if err != nil {
|
||||
return &ReadError{Path: path, Cause: err}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user