harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.89k stars 2.78k forks source link

Drone use PAT owner account for git commit #3501

Closed nmapx closed 2 months ago

nmapx commented 2 months ago

Hi @bradrydzewski, I followed your documentation to set up a machine user on Github https://docs.drone.io/pipeline/docker/syntax/cloning/auth/ If I understood it correctly it should clone the repository and allow also for git commit and git push using the same bot account within the pipelines. So I set up both variables, cloning is probably done through PAT (I can see the activity on this token) but pushing (in my case I want to push a commit and create a tag) is still done by other account - the one that did the commit before. Any way to force git user on pipeline runtime? I can't use plugin here - I need to do this directly from the CLI.

nmapx commented 2 months ago

Nevermind It seems that overwriting the env vars (all 4 of them!) does the trick

Changes to git config ... doesn't work since env vars overwrite it later anyway.