抱佛脚 (抱佛腳) bàofójiǎo

bàofójiǎo noun to clasp the Buddha's feet (without ever having burned incense); to profess devotion only when in trouble
Domain: Modern Chinese 现代汉语
Notes: (CC-CEDICT '抱佛腳')

Also contained in

平时不烧香,临时抱佛脚临时抱佛脚