fix(agentcompat): root workflow file reads

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
naiba
2026-07-20 17:06:40 +00:00
co-authored by naiba/CloudCode
parent 24c7a898cf
commit 0332b1e212
@@ -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}
}