Many biotic or abiotic factors such as CPPU (N-(2-chloro-pyridin-4-yl)-N'-phenylurea), a growth regulator of numerous crops, can induce bitterness in cucurbits. In melon, cucurbitacin B is the major compound leading to bitterness. However, the molecular mechanism underlying CuB biosynthesis in response to different conditions remains unclear. Here, we identified a set of genes involved in CPPU-induced CuB biosynthesis in melon fruit and proposed CmBr gene as the major regulator. Using CRISPR/Cas9 gene editing, we confirmed CmBr's role in regulating CuB biosynthesis under CPPU treatment. We further discovered a CPPU-induced MYB-related transcription factor, CmRSM1, which specifically binds to the Myb motif within the CmBr promoter and activates its expression. Moreover, we developed an introgression line by introducing the mutated Cmbr gene into an elite variety and eliminated CPPU-induced bitterness, demonstrating its potential application in breeding. This study offers a valuable tool for breeding high-quality non-bitter melon varieties and provides new insights into the regulation of secondary metabolites under environmental stresses.