File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ inputs:
1717 description : ' JSON array of last known USNs'
1818 required : false
1919 default : ' []'
20+ last_usns_filepath :
21+ description : ' Similar to last_usns, but instead of pointing into a variable, it points to a file'
22+ required : false
2023 packages :
2124 description : ' JSON array of stack package names'
2225 required : false
3942 - " ${{ inputs.feed_url }}"
4043 - " --last-usns"
4144 - " ${{ inputs.last_usns }}"
45+ - " --last-usns-filepath"
46+ - " ${{ inputs.last_usns_filepath }}"
4247 - " --packages"
4348 - " ${{ inputs.packages }}"
4449 - " --packages-filepath"
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ func main() {
4848 var config struct {
4949 Distro string
5050 LastUSNsJSON string
51+ LastUSNsJSONFilepath string
5152 Output string
5253 PackagesJSON string
5354 PackagesJSONFilepath string
@@ -59,6 +60,10 @@ func main() {
5960 "last-usns" ,
6061 "" ,
6162 "JSON array of last known USNs" )
63+ flag .StringVar (& config .LastUSNsJSONFilepath ,
64+ "last-usns-filepath" ,
65+ "" ,
66+ "Filepath that points to the JSON array of last known USNs" )
6267 flag .StringVar (& config .RSSURL ,
6368 "feed-url" ,
6469 "https://ubuntu.com/security/notices/rss.xml" ,
@@ -108,6 +113,19 @@ func main() {
108113 log .Fatal (err )
109114 }
110115
116+ if config .LastUSNsJSONFilepath != "" {
117+
118+ lastUSNsFilepath , err := os .ReadFile (config .LastUSNsJSONFilepath )
119+ if err != nil {
120+ log .Fatal (err )
121+ }
122+
123+ err = json .Unmarshal (lastUSNsFilepath , & lastUSNs )
124+ if err != nil {
125+ log .Fatal (err )
126+ }
127+ }
128+
111129 var packages []string
112130 err = json .Unmarshal ([]byte (config .PackagesJSON ), & packages )
113131 if err != nil {
You can’t perform that action at this time.
0 commit comments