File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ jobs:
2525 go-version : ' 1.21'
2626
2727 - name : Run Go application
28- working-directory : ./src
2928 run : |
30- go build -o ./src/ update-advisory main.go
31- ./src/ update-advisory
32- rm ./src/ update-advisory
29+ go build -o ./update-advisory main.go
30+ ./update-advisory
31+ rm ./update-advisory
3332
3433 - name : Commit changes
3534 run : |
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import (
1919 "encoding/json"
2020 "fmt"
2121 "os"
22+ "path/filepath"
23+ "runtime"
2224 "strings"
2325 "time"
2426
6365 now = time .Now ()
6466 nowTimestamp = now .Format (time .RFC3339 )
6567 today = format (now )
66- policyPath = "./ policies/V8-policy.json"
68+ policyPath = "policies/V8-policy.json"
6769 cachePath = "src/V8-cache.json"
6870 advisoryPath = "advisories/V8-advisory.json"
6971)
@@ -110,7 +112,10 @@ func main() {
110112}
111113
112114func loadPolicy () (* Policy , error ) {
113- data , err := os .ReadFile (policyPath )
115+ _ , filename , _ , _ := runtime .Caller (0 )
116+ dir := filepath .Dir (filename )
117+ advisoryFilePath := filepath .Join (dir , "../advisories/V8-advisory.json" )
118+ data , err := os .ReadFile (advisoryFilePath )
114119 if err != nil {
115120 return nil , err
116121 }
You can’t perform that action at this time.
0 commit comments