Safety when disclosing hashes of secrets used to calculate other secrets
The security concern is that the result of that operation will be guessable without the secret number, since the later part of that answer explains why it also applies to SHA-256.

(Also, $\:$ SHA256(A+"") = SHA256(A)$\:$.)

The random number should be long enough to make brute-force highly infeasible.

If it is and you publish HMAC(A,"") and present them with the values of HMAC(A,B),

then the result of those operations should not be guessable for non-empty strings B.