Wesfarmers has signed a AUD400 million ($246 million) sustainability-linked loan with Commonwealth Bank of Australia.