File tree 2 files changed +20
-5
lines changed
2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 16
16
{{- $id = . -}}
17
17
{{ end }}
18
18
19
+ {{- $release := dict -}}
19
20
{{- $url := (printf "https://api.github.com/repos/%s/%s/releases/%s" $user $repo $tag) -}}
20
- {{- $release := getJSON $url -}}
21
+ {{ with resources.GetRemote $url }}
22
+ {{ with .Err }}
23
+ {{ errorf "%s" . }}
24
+ {{ else }}
25
+ {{ $data = . | transform.Unmarshal }}
26
+ {{ end }}
27
+ {{ else }}
28
+ {{ errorf "Unable to get remote resource %q" $url }}
29
+ {{ end }}
21
30
22
31
{{- with (index $release.assets $id) -}}
23
32
{{ $p := . }}
Original file line number Diff line number Diff line change 16
16
{{- $id = . -}}
17
17
{{ end }}
18
18
19
- {{- $url := (printf "https://api.github.com/repos/%s/%s/releases/%s" $user $repo $tag) -}}
20
- {{- $url := "data/ghrelease.json" -}}
21
- {{- $release := getJSON $url -}}
19
+ {{- $release := dict -}}
20
+ {{- $path := "data/ghrelease.json" -}}
21
+ {{- with resources.Get $path -}}
22
+ {{- with . | transform.Unmarshal -}}
23
+ {{- $release = . -}}
24
+ {{- end -}}
25
+ {{- else -}}
26
+ {{ errorf "Unable to get global resource %q" $path }}
27
+ {{- end -}}
22
28
23
29
{{- with (index $release.assets $id) -}}
24
- {{ $p := . }}
30
+ {{- $p := . - }}
25
31
{{- if eq $data "file_name" -}}
26
32
{{- $p.name -}}
27
33
{{- else if eq $data "file_size" -}}
You can’t perform that action at this time.
0 commit comments