The 27-year-old came clean during an interview with Michael Strahan in Wednesday's episode of Good Morning America.
Director JJ Abrams revealed the incident on Monday but he declined to name the star responsible.
The 53-year-old said: “One of our actors left [the script] under their bed, and it was found by someone who was cleaning their place. And it was given to someone else who went to sell it on eBay.”
Strahan then put the matter to Boyega, who told the shocked and amused crowd: "It was me."
“Let me tell you how this one went down," he said. "What had happened was… I was moving apartments and I left the script under my bed. I was just like, you know what, 'I'll leave it under my bed.
“'When I wake up in the morning I'll take it and move', but my boys came over and, you know, we started partying a little bit and then the script just - it just stayed there.”
He continued: “Then a few weeks after, you know, a cleaner comes in, finds the script and then puts it on eBay for like £65.”
He joked: “So the person didn't know the true value.”
Thankfully, the team working on Star Wars noticed the script was on eBay and purchased it before anyone could find out the plot.
However, the script that went missing did not include the ending because the cast “shot several different things.”
Boyega added: “I'm curious. I think I'll watch the movie next week for the first time.”
Abrams is at the helm of the final instalment, which completes Disney's latest Star Wars trilogy after 2015's The Force Awakens and 2017's The Last Jedi.
Rey (played by Daisy Ridley), Kylo Ren (Adam Driver), Poe Dameron (Oscar Isaac) and Finn (Boyega) are all returning to the fold, while Carrie Fisher, who died in 2016 aged 60, will also be in the film.
The movie will feature unused footage of Leia, shot when they were making The Force Awakens, and while there's no CGI, there will be some digital manipulation.
The Rise of Skywalker is slated for release in the UK on Thursday December 19 and will be almost two-and-a-half hours long.