In reference to your query, your understanding is correct that you do not need to pay GST on foreign income. However this is subject to the condition that in order to earn such income, no supply of service is being provided from India. If this be the case, then the transaction would qualify as export of service and you would be required to take GST registration and comply with the provisions and procedures.
However, further to the above in case of provision of services, if your aggregate annual turnover does not exceed Rs. 20 Lakhs in a financial year, GST registration is optional.
In case GST registration is mandatory / taken, in that case the option of LUT can also be explored wherein the requirement of payment of GST would be obviated.
Please advise in case of any further clarification.
Thanks & Regards,
CA Aditya Dhanuka.