Skip to content

Commit

Permalink
Remove Github API from generating hab release notes
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Maddaus <[email protected]>
  • Loading branch information
IanMadd committed Mar 15, 2022
1 parent fff8196 commit 2413d90
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
32 changes: 32 additions & 0 deletions assets/release-notes/habitat/release-versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
"1.6.420",
"1.6.416",
"1.6.415",
"1.6.400",
"1.6.351",
"1.6.319",
"1.6.288",
"1.6.267",
"1.6.235",
"1.6.216",
"1.6.181",
"1.6.175",
"1.6.139",
"1.6.115",
"1.6.56",
"1.6.39",
"1.6.0",
"1.5.86",
"1.5.71",
"1.5.50",
"1.5.29",
"1.5.0",
"0.90.6",
"0.88.0",
"0.85.0",
"0.83.0",
"0.82.0",
"0.81.0",
"0.80.0",
"0.79.1"
]
6 changes: 1 addition & 5 deletions themes/docs-new/layouts/_default/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{ if eq $product "automate" }}
{{ $versionsUrl = "https://packages.chef.io/releases/current/automate.json"}}
{{ else if (eq $product "habitat") }}
{{ $versionsUrl = "https://api.github.com/repos/habitat-sh/habitat/releases" }}
{{ $versionsUrl = "assets/release-notes/habitat/release-versions.json" }}
{{ else if (hasPrefix $product "inspec-") }}
{{ $versionsUrl = print "_vendor/github.com/inspec/" $product "/docs-chef-io/assets/release-notes/" $product "/release-dates.json" }}
{{ else }}
Expand All @@ -41,8 +41,6 @@

{{ if eq $product "automate" }}
{{ $version = index . "version" }}
{{ else if eq $product "habitat" }}
{{ $version = index . "tag_name" }}
{{ else }}
{{ $version = . }}
{{ end }}
Expand Down Expand Up @@ -83,8 +81,6 @@ <h2 id="{{ $version }}">{{ $fullName }} {{ $version }}</h2>

{{ if eq $product "automate"}}
<p><i>Released on {{ time.Format "January 2, 2006" .release_date }}</i></p>
{{ else if (eq $product "habitat")}}
<p><i>Released on {{ time.Format "January 2, 2006" .published_at }}</i></p>
{{ end }}

{{ $remoteResponse := resources.GetRemote $mdUrl (dict "headers" (dict "Cache-Control" "no-cache" "Connection" "keep-alive")) }}
Expand Down
8 changes: 1 addition & 7 deletions themes/docs-new/layouts/partials/release_notes_toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{ if eq $product "automate" }}
{{ $versionsUrl = "https://packages.chef.io/releases/current/automate.json"}}
{{ else if (eq $product "habitat") }}
{{ $versionsUrl = "https://api.github.com/repos/habitat-sh/habitat/releases" }}
{{ $versionsUrl = "assets/release-notes/habitat/release-versions.json" }}
{{ else if (hasPrefix $product "inspec-") }}
{{ $versionsUrl = print "_vendor/github.com/inspec/" $product "/docs-chef-io/assets/release-notes/" $product "/release-dates.json" }}
{{ else }}
Expand Down Expand Up @@ -50,12 +50,6 @@
{{ $lastDate = $releaseYearMonth }}
{{ end }}
</ul>
{{ else if eq $product "habitat" }}
<ul>
{{ range $version := $versionsCorrectOrder }}
<li><a href="#{{ $version.tag_name }}">{{ $version.tag_name }}</a></li>
{{ end }}
</ul>

{{ else }}
<ul>
Expand Down

0 comments on commit 2413d90

Please sign in to comment.