Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
Personally i use Github branch protection rules to prevent merging into
stable
andmaster
-branches without a pull request review. This prevents thefork-sync
action to automatically merge the changes of the forked repository into my personal fork. Generally speaking i don't want to change the branch-protection-rules because when talking about regular code-changes these make perfectly sense to me.What this change implements:
This PR adds a new feature "auto-approve" which can be activated optionally by setting
auto_approve
andpersonal_token
input variables. After the pull request is created by thefork-sync
action theauto_approve
variable will be checked. If it's set totrue
the action will approve the changes made by the pull request created before with the user which belongs to thepersonal_token
. Also a comment on this review will be generated which makes it clear that this review was automatically generated. Afterwards thegithub-actions
bot is able to merge the pull request.A possible result will look like this:
This changes solves:
Branch protection rules regarding the review process can exist next to the
fok-sync
action.Also in this PR:
When testing i noticed that there was a situation where an error occured and
error.errors
was set and contained one element which had nomessage
property so i receivedCannot read property 'startsWith' of undefined
.fork-sync/src/main.ts
Line 35 in 9671705
I improved this, too.
Let me know what you think about this
Cheers :-)