scripts: fix revision calculation using new "main" branch