Only half of the story is quoted here. The other half is Ghana is forcing gold refiners to sell 20% to the Ghanan central bank in “cedis at spot prices with no discounts”[1]. So they are minting cedis to buy gold, then trade that gold for oil instead of dollars. If the trade was instead to sell for dollars, it’s more politically obvious that the policy is a tax on gold miners and refiners.
[1] https://www.reuters.com/markets/commodities/ghana-orders-min...