Fix: set git identity

This commit is contained in:
[BOT] pages deployer 2023-08-25 23:52:03 +02:00
parent c63c30fa47
commit 8e41642780
Signed by untrusted user who does not match committer: dorian
GPG key ID: 989DE36109AFA354

12
main.go
View file

@ -65,10 +65,6 @@ func Exec(args Args) error {
}
}
if err := writeConfig(args); err != nil {
return err
}
if err := copyFiles(args); err != nil {
return err
}
@ -77,6 +73,10 @@ func Exec(args Args) error {
return err
}
if err := writeConfig(args); err != nil {
return err
}
if err := doCommit(args); err != nil {
return err
}
@ -122,11 +122,11 @@ func checkArgs(args *Args) error {
}
func writeConfig(args Args) error {
if err := repo.GlobalName("[BOT] pages deployer").Run(); err != nil {
if err := execute(exec.Command("git", "config", "user.name", "[BOT] pages deployer")); err != nil {
return err
}
if err := repo.GlobalUser("noreply@pages.bot").Run(); err != nil {
if err := execute(exec.Command("git", "config", "user.email", "noreply@pages.bot")); err != nil {
return err
}