Make branch protection attempt less restrictive

In case if something wrong happens along the way when trying to apply protection of a newly created branch - log error, instead of throwing an it, making scaffolder exit with non-zero exit code.
This one addresses the issue #6330

Signed-off-by: Eugene S <jh.sh@me.com>
This commit is contained in:
Eugene Sh
2021-07-02 22:17:32 +03:00
committed by Eugene S
parent afeffa7492
commit 253136fba7
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
removing mandatory of protection for the default branch, that could be handled by the GitHub automation in async manner, thus throwing floating errors
@@ -268,8 +268,8 @@ export function createPublishGithubAction(options: {
defaultBranch,
});
} catch (e) {
throw new Error(
`Failed to add branch protection to '${newRepo.name}', ${e}`,
ctx.logger.warn(
`Skipping: default branch protection on '${newRepo.name}', ${e.message}`,
);
}