Skip to content

Commit

Permalink
Merge pull request #1287 from alphagov/fix-version-header
Browse files Browse the repository at this point in the history
Fix release SHA in footer
  • Loading branch information
deborahchua authored Sep 20, 2023
2 parents 7bc0672 + 887a079 commit 2084350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
<%= yield %>
</main>

<p class="govuk-body-s">Version: <%= CURRENT_RELEASE_SHA %></p>
<% if !CURRENT_RELEASE_SHA.nil? %>
<p class="govuk-body-s">Version: <%= CURRENT_RELEASE_SHA %></p>
<% end %>
</div>

<%= render "govuk_publishing_components/components/layout_footer", {} %>
Expand Down
7 changes: 1 addition & 6 deletions config/initializers/current_release_sha.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
if Rails.root.join("REVISION").exist?
revision = File.read(Rails.root.join("REVISION")).chomp
CURRENT_RELEASE_SHA = revision[0..10] # Just get the short SHA
else
CURRENT_RELEASE_SHA = "development".freeze
end
CURRENT_RELEASE_SHA = `git rev-parse HEAD`.chomp[0..10] # Just get the short SHA

0 comments on commit 2084350

Please sign in to comment.