I have a valid work permit but it will be expired 6 days after entering China, can I use it to return to Shanghai??
You have a valid work permit. How about your residence permit?
If both are valid, I think you still have a chance to get in before it expires. I would definitely call your local Chinese embassy/consulate and the airline to make sure though. Also don’t forget you need to do a covid check 72 hrs before boarding the plane. Processes are different depending on the country so you also want to double check this when you call your local Chinese embassy/consulate. You can check out some documents regarding entering China on this page: https://shanghaiexitentry.com/entering-china/