How can you automatically import the latest github commit number from github?
The goal would be to have that number visible on your webpage footer like SO does with date.
Whats the structure:
I have a production branch which is deployed using Capistrano. I want to show the latest github commit number, with the date when it was deployed.
Assuming you use gem
settingslogicfor app settings, put this in your initializers:You will have last git commit SHA in
Settings.git_revisionand commit date inSettings.git_update.Additionally you can get last tag:
It will be available in
Settings.git_tag.Update:
I released a small ruby gem git-revision. With it you can simply do: