In the midst of the global push for environmental protection and sustainable development, supply chain digitalization (SCD) has become a key enabler of both operational efficiency and green production. The existent literature, however, has mainly focused on SCD's impact on operational efficiency, neglecting its role in advancing environmental sustainability through green total factor productivity (GTFP). This study addresses this gap by examining how SCD influences GTFP, both directly and indirectly via the mechanism of supply chain resilience (SCR). Data from Chinese A-share firms between 2013 and 2023 was analyzed using a comprehensive double machine learning approach, revealing SCD's significant positive impact on GTFP and the crucial role of SCR in this relationship. Heterogeneity analysis further indicated that SCD's ability to improve GTFP is most pronounced in state-owned firms, heavily polluting industries, and economically developed regions, adding an original dimension to the findings. By establishing the critical role of SCD in promoting environmental sustainability, this study makes valuable contributions to the literature and offers policy insights for countries aiming to accelerate the digitalization and green transformation of their supply chains.