Almost.  What we're looking for here is a match between the username in the 'azure' remote of the Git repository and the $GIT_USERNAME value passed in to publishing password.  There is no need to check the RepositryUserName against the siteproperties.