[GH-ISSUE #41] clean up changed .git/config user after run #23

Closed
opened 2026-03-01 21:39:11 +03:00 by kerem · 5 comments
Owner

Originally created by @maxheld83 on GitHub (Feb 21, 2019).
Original GitHub issue: https://github.com/nektos/act/issues/41

When act runs with some git action in the root, it appears to set a new nektos/act user in the .git/config.
That makes a ton of sense.

However, it'd be nice if act could clean up after itself, and revert this change on success or failure, so that I don't muck up my git config.

I think this "problem" only happens in the relatively rare situation where you're running some git actions directly in your root.
An example would be (as in my case) when I deploy to GitHub pages from the root: said action then git inits stuff right in my repo root, locally, thus overwriting/amending my own .git/config.

I just commited a bunch of stuff and was really surprised that I had somehow become nektos/act 😸.

This software is phenomenal, thanks for the generous work @nektos!

(this is somewhat related to #28 I think?)

Originally created by @maxheld83 on GitHub (Feb 21, 2019). Original GitHub issue: https://github.com/nektos/act/issues/41 When `act` runs with some git action in the root, it appears to set a new `nektos/act` user in the `.git/config`. That makes a ton of sense. However, it'd be nice if `act` could clean up after itself, and revert this change on success or failure, so that I don't muck up my git config. I think this "problem" only happens in the relatively rare situation where you're running some git actions *directly in your root*. An example would be (as in my case) when I deploy to GitHub pages from the root: said action then `git init`s stuff right in my repo root, locally, thus overwriting/amending my own `.git/config`. I just commited a bunch of stuff and was really surprised that I had somehow become `nektos/act` 😸. This software is phenomenal, thanks for the generous work @nektos! (this is somewhat related to #28 I think?)
kerem closed this issue 2026-03-01 21:39:12 +03:00
Author
Owner

@maxheld83 commented on GitHub (Feb 21, 2019):

oh, and if someone else is so dense as myself as to do this to your commit history, here's how you can fix it: https://stackoverflow.com/questions/4981126/how-to-amend-several-commits-in-git-to-change-author.

Needs git push --force at the end.

<!-- gh-comment-id:466003460 --> @maxheld83 commented on GitHub (Feb 21, 2019): oh, and if someone else is so dense as myself as to do this to your commit history, here's how you can fix it: https://stackoverflow.com/questions/4981126/how-to-amend-several-commits-in-git-to-change-author. Needs `git push --force` at the end.
Author
Owner

@nicolo-ribaudo commented on GitHub (Feb 22, 2019):

As a workaround, I'm doing

git -c user.name="Name" -c user.email="email@email.com" commit -m "Commit made by different author!"

in actions so that I don't need to update the git config for the repo.

<!-- gh-comment-id:466353920 --> @nicolo-ribaudo commented on GitHub (Feb 22, 2019): As a workaround, I'm doing ``` git -c user.name="Name" -c user.email="email@email.com" commit -m "Commit made by different author!" ``` in actions so that I don't need to update the git config for the repo.
Author
Owner

@cplee commented on GitHub (Feb 22, 2019):

Would #21 address this issue? In summary, allow act to run in a temp directory with a fresh checkout of the repo.

<!-- gh-comment-id:466449317 --> @cplee commented on GitHub (Feb 22, 2019): Would #21 address this issue? In summary, allow act to run in a temp directory with a fresh checkout of the repo.
Author
Owner

@maxheld83 commented on GitHub (Feb 22, 2019):

yeah I think it would @cplee because then whatever git commands need to be run inside actions, and whatever changes they would make to .git/config would be inside that temp dir.

<!-- gh-comment-id:466455654 --> @maxheld83 commented on GitHub (Feb 22, 2019): yeah I think it would @cplee because then whatever git commands need to be run inside actions, and whatever changes they would make to `.git/config` would be inside that temp dir.
Author
Owner

@cplee commented on GitHub (Feb 25, 2020):

As of 0.2.2, act no longer runs against a bind mount of local dir...instead a volume is created and workdir is copied into volume

<!-- gh-comment-id:590713504 --> @cplee commented on GitHub (Feb 25, 2020): As of `0.2.2`, act no longer runs against a bind mount of local dir...instead a volume is created and workdir is copied into volume
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#23
No description provided.