sdk: invert logic for GIT_BRANCH and GIT_TAGNAME
There is currently a logic error with generating the base feed string.
In the scenario where the commit of a Tag match the latest commit of a
stable branch, the stable branch have priority over the tag name.
This results in generating SDK that actually target the branch instead
of the specific tag.
To fix this invert the logic and give priority to the tag name.
Fixes: #18583
(cherry picked from commit
289172b00e7193df8a2afa1eee54b43148470698)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>