Fix credentials fetching during publishing

Reviewed at https://rbcommons.com/s/twitter/r/901/