audiobookshelf icon indicating copy to clipboard operation
audiobookshelf copied to clipboard

[Enhancement]: Add commit hash to server page

Open nichwall opened this issue 1 year ago • 3 comments

Describe the feature/enhancement

Adding the commit hash to the server settings page would be handy for issues reported by users on :edge. Something similar to how Mealie does it would be good (pictured below).

Then, there can just be a text box in the issue template for the hash to be pasted into if the reporter is not using a release.

Mealie Commit Hash

nichwall avatar May 05 '24 16:05 nichwall

Are they building on every commit? We might be able to pass something through from the gh action to the Docker file

advplyr avatar May 05 '24 20:05 advplyr

I'm not sure. I think it is built on every commit and it just passed through. Those commit hashes match up to commits in GH but I'm not updating on every commit and haven't paid enough attention to when it changes. (Referring to Mealie)

nichwall avatar May 05 '24 20:05 nichwall

After additional research, we can use GITHUB_SHA in a workflow to get the commit hash of the commit that triggers the workflow. https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

It looks like Mealie just uses an internal environment variable for this. https://github.com/mealie-recipes/mealie/blob/dabd93c91915c7531686bebe29634d28ab456275/mealie/core/settings/settings.py#L56

Another option is overwriting the value in a "constants" file during the workflow so any build images will use the SHA. Not sure how to also do that when building from source (outside of workflow), but if building from source the user would be able to get the hash from their local repo.

nichwall avatar May 06 '24 00:05 nichwall