Fix build.get_revision() for GIT repositories

Filter out actions which are None or not of interest and then extract the git revision from the lastBuiltRevision. Works in cases where branch is of something other than origin/HEAD