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
cda2c38f4a
I saw the CI config has this block:

cda2c38f4a/.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:

a69878c006/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 <hrsi88@gmail.com>
This commit is contained in:
Yarden Shoham 2022-10-14 22:09:04 +03:00 committed by GitHub
parent 6bb6a108e0
commit 94d6d93cc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -626,6 +626,8 @@ steps:
commit_message: "[skip ci] Updated translations via Crowdin" commit_message: "[skip ci] Updated translations via Crowdin"
remote: "git@github.com:go-gitea/gitea.git" remote: "git@github.com:go-gitea/gitea.git"
environment: environment:
DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io"
DRONE_COMMIT_AUTHOR: GiteaBot
GIT_PUSH_SSH_KEY: GIT_PUSH_SSH_KEY:
from_secret: git_push_ssh_key from_secret: git_push_ssh_key
@ -670,12 +672,14 @@ steps:
pull: always pull: always
settings: settings:
author_email: "teabot@gitea.io" author_email: "teabot@gitea.io"
author_name: GiteaBot author_name: "GiteaBot"
branch: main branch: main
commit: true commit: true
commit_message: "[skip ci] Updated licenses and gitignores " commit_message: "[skip ci] Updated licenses and gitignores"
remote: "git@github.com:go-gitea/gitea.git" remote: "git@github.com:go-gitea/gitea.git"
environment: environment:
DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io"
DRONE_COMMIT_AUTHOR: "GiteaBot"
GIT_PUSH_SSH_KEY: GIT_PUSH_SSH_KEY:
from_secret: git_push_ssh_key from_secret: git_push_ssh_key