We already have this feature as part of code coverage action and there is a mention in https://github.com/barecheck/code-coverage-action/issues/101 to use github lib for it.