Refactor GitHub protected branches stage to resume work from where it left off when restarted
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Work on this issue](https://contributors.gitlab.com/manage-issue?action=work&projectId=278964&issueIid=429309) - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=429309) </details> <!--IssueSummary end--> This issue came out of this discussion https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134949#note_1615909595. ### About https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134949 raises the max number of Sidekiq interruptions for GitHub stage workers that are able to resume their work exactly from where they left off when they are restarted. There are a few workers noted on that MR that do not restart exactly where they left off, so do not have the limit raised for them. Of these workers, `Stage::ImportProtectedBranchesWorker` (the protected branch stage worker) is one that could take a long time to complete as it pages through all branches of the GitHub repo. ### Proposal Refactor the stage worker to resume its work exactly where it left off. And then apply the `resumes_work_when_interrupted!` method to it.
issue