Hey,
I wonder if someone has looked into the following use-case:
We want to digitally "sign" all commits created on e.g. the master branch based on a number of criteria. These could be approved by at least 1 reviewer, task list in PR completed etc.
I know that these "rules" can be applied as project/repo configuration but we do have lots of repo admins that potentially can disable these checks and circumvent them. This is all captured in the audit log but it is usually too late if the commit has already hit the production system.
My idea is therefore to introduce an event listener that triggers on PR merged and in theses cases run the list of criteria on that PR and merge commit and if it fulfills all of them digitally sign the merge commit on the master branch. With this in place we can instruct our pipelines to only deploy changes that has passed these checks.
Has anyone implemented something similar? Or is there a better way to approach this (without revoking the repo admin permissions from people)?
We do have the Scriptrunner for Bitbucket so any ideas or pointers implemented with Groovy are highly appreciated.
Cheers!