This pr fixes the permission issue pre-commit GitHub Action was experiencing.
Turns out GitHub issues conservative permission to pull requests coming from a private fork, see: link.
To get write permission, we need to use pull_request_target as event trigger instead. In pull_request_target GitHub Actions checks out the base branch instead of the pr, so we need to manually checkout the pull request via GitHub CLI.
This pr fixes the permission issue pre-commit GitHub Action was experiencing.
Turns out GitHub issues conservative permission to pull requests coming from a private fork, see: link.
To get write permission, we need to use
pull_request_target
as event trigger instead. Inpull_request_target
GitHub Actions checks out the base branch instead of the pr, so we need to manually checkout the pull request via GitHub CLI.See: https://github.com/bean-men/testing-exempler/pull/6 as an example of correct output. Note that the pr come from my private fork from
wusatosi/testing-exempler
to an org inbean-man/testing-exempler
.Due to the introduced complexity, this pr also splits the
pre-commit
check for push and pull-request into two different jobs.Closes #49 . (again).