Skip to content

Commit 94d6d93

Browse files
authored
Fix Drone pushing commits with wrong author info (#21450)
I don't know how to test this so I'll explain my thought process: After a discussion with @techknowlogick in cda2c38 I saw the CI config has this block: https://github.com/go-gitea/gitea/blob/cda2c38f4a61ef7f448be3efab5420d9974c8474/.drone.yml#L618-L630 I don't know much about Drone but after looking at [appleboy/drone-git-push](https://github.com/appleboy/drone-git-push)'s source code, I think each setting becomes an environment variable (e.g. `remote` to `PLUGIN_REMOTE`, `commit_message` to `PLUGIN_COMMIT_MESSAGE` etc...). Take a look at the code block loading the author info: https://github.com/appleboy/drone-git-push/blob/a69878c00665277c53fb38d6c5980221cb687935/main.go#L32-L42 Two environment variables are listed for each setting. This PR forces both to have the same value. Signed-off-by: Yarden Shoham <[email protected]>
1 parent 6bb6a10 commit 94d6d93

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.drone.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ steps:
626626
commit_message: "[skip ci] Updated translations via Crowdin"
627627
remote: "[email protected]:go-gitea/gitea.git"
628628
environment:
629+
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
630+
DRONE_COMMIT_AUTHOR: GiteaBot
629631
GIT_PUSH_SSH_KEY:
630632
from_secret: git_push_ssh_key
631633

@@ -670,12 +672,14 @@ steps:
670672
pull: always
671673
settings:
672674
author_email: "[email protected]"
673-
author_name: GiteaBot
675+
author_name: "GiteaBot"
674676
branch: main
675677
commit: true
676-
commit_message: "[skip ci] Updated licenses and gitignores "
678+
commit_message: "[skip ci] Updated licenses and gitignores"
677679
remote: "[email protected]:go-gitea/gitea.git"
678680
environment:
681+
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
682+
DRONE_COMMIT_AUTHOR: "GiteaBot"
679683
GIT_PUSH_SSH_KEY:
680684
from_secret: git_push_ssh_key
681685

0 commit comments

Comments
 (0)