Fix: update info: compare to respective branch

official release builds are built from branch master, as the respective
tags point to commits in branch master (only). to check whether or not a
new version is available, we should check branch master for new commits.

checking against HEAD does not work as expected, at least in the
OpenDTU-OnBattery repo, since its default branch is "development", not
"master".

usually, there should be no commits on master in between releases, so we
will now only show "update available" if a new release was made. this is
not foolproof, but should work as long as we keep "master" clean.

for builds from other branches, the comparison is perfomed against the
respective branch. if a user installed a binary built by github actions
based on a development branch, the user will see "update available" if
new commits were added to the development branch since.

for other branches, also pull request builds, the test for updates will
fail as the branch name shown in the system info is not actually a
branch name, e.g., "helgeerbe/OpenDTU-OnBattery/pr1183-202408212043".
This commit is contained in:
Bernhard Kirchen 2024-08-23 16:24:01 +02:00
parent 65407dbdd6
commit b115f946cd

View File

@ -79,7 +79,8 @@ export default defineComponent({
const fetchUrl = const fetchUrl =
'https://api.github.com/repos/helgeerbe/OpenDTU-OnBattery/compare/' + 'https://api.github.com/repos/helgeerbe/OpenDTU-OnBattery/compare/' +
this.systemDataList.git_hash + this.systemDataList.git_hash +
'...HEAD'; '...' +
this.systemDataList.git_branch;
fetch(fetchUrl) fetch(fetchUrl)
.then((response) => { .then((response) => {