Three middle-aged men and five minors in Cerme district of Gresik Regency, East Java, were given the unique punishment on September 9, authorities said.
Though mask-wearing is mandatory in public throughout Indonesia, there has been a vocal segment of the population that has been reluctant to wear masks and practice social distancing.
Experts say the lack of public vigilance has made it more difficult for Indonesian authorities to stymie the spread of the virus, which to date has infected nearly 230,000 people in the country. More than 160,000 of those patients have recovered, while at least 9,100 have died, according to the Indonesian Health Ministry.
As cases spiked in recent months, Indonesia's government passed a law in July requiring people to wear masks in public, but left it to local officials to determine punishments for noncompliance. A joint team called the "three pillars" -- which consists of the Indonesian National Armed Forces, Indonesian National Police and local law enforcement -- are in charge of enforcing mask restrictions across the country.
In Cerme, the "three pillars" gives those caught not wearing a mask the option of accepting a fine of 150,000 rupiah ($10) or accepting what the government calls "social punishment," according to the district's leader, Suyono.
Suyono, who goes by one name, told CNN most people have accepted the social punishment, which often involves push-ups or cleaning. But he hopes options like grave-digging would be educational and show "firsthand the real and serious effect of Covid-19." None of those punished were present when the dead were buried, Suyono said.
Authorities in the capital of Jakarta adopted a similar idea earlier this month. A man there was required to sit in a coffin in public after being caught not wearing a mask.
However, it's not clear if these types of penalties have increased mask-wearing in Indonesia. The country has failed to flatten the curve for months and infections are still on the rise -- only the Philippines has recorded more cases in Southeast Asia.
Large-scale social restrictions were put in place in Jakarta on Sunday, the second time authorities have been forced to do so since the pandemic began.
With cases still climbing, the city's health infrastructure may be nearing a breaking point. The emergency units in all 20 Jakarta hospitals approved to treat Covid-19 patients are full, officials said Monday.
CNN's Joshua Berlinger and journalist Nadira Arnindya contributed to this report