Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address permissions error when committing format changes #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yassiezar
Copy link

Re-opened, since I used the wrong feature branch in the previous PR

I've run permissions trouble when committing the changes made after running the formatter. It turns out that the Docker user defaults to root, so the commit action isn't able to add the changes to the git repo. I've added a USER argument in the Dockerfile to assume UID 1001, GUID 121 (observed when running ls -la .git/objects after running the formatter) which has solved my permissions issue. The alternative is to chown -R the entire git repo, but this seemed more elegant to me. Note that the UID/GUID might be different for other users, so I'll need to look into automating this discovery somehow

I also added a parameter to format against a different base to HEAD^ (e.g. master) - I thought it useful when working with large PRs

…hat root. This solves the permission error more elegantly that setting safe dir or changing the ownership to root
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.

1 participant