Added link to gitea commit to sidebar
This commit is contained in:
11
config/initializers/git_revision.rb
Normal file
11
config/initializers/git_revision.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# config/initializers/git_revision.rb
|
||||
|
||||
# 1. Versuch: Über eine Umgebungsvariable (Standard bei Docker/Render/Heroku)
|
||||
CURRENT_COMMIT = ENV["GIT_COMMIT_SHA"] ||
|
||||
ENV["RENDER_GIT_COMMIT"] ||
|
||||
# 2. Versuch: Direkt aus dem lokalen .git Ordner auslesen
|
||||
begin
|
||||
`git rev-parse --short HEAD`.strip
|
||||
rescue
|
||||
nil
|
||||
end
|
||||
Reference in New Issue
Block a user