Skip to content

Proper permission fix for reviewdog#69

Merged
wusatosi merged 1 commit intobemanproject:mainfrom
wusatosi:fix-permission
Nov 10, 2024
Merged

Proper permission fix for reviewdog#69
wusatosi merged 1 commit intobemanproject:mainfrom
wusatosi:fix-permission

Conversation

@wusatosi
Copy link
Copy Markdown
Member

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.

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 in bean-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).

Comment thread .github/workflows/pre-commit.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review dog failing in CI due to insufficient permission

2 participants