From 954082a5afa3f2d4a3292c3e7db291aa35caa2af Mon Sep 17 00:00:00 2001 From: Nils Briggen Date: Thu, 24 Sep 2026 23:33:52 +0200 Subject: [PATCH] Attribute GitHub snapshots to source contributors --- scripts/ci/github_release.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/ci/github_release.py b/scripts/ci/github_release.py index c0495a41e..4a8ac46d8 100644 --- a/scripts/ci/github_release.py +++ b/scripts/ci/github_release.py @@ -75,9 +75,19 @@ def mirror_and_dispatch(): if git_output("-C", str(mirror), "write-tree") != source_tree: raise ValueError("GitHub snapshot does not match the Gitea source tree.") if subprocess.run(["git", "-C", str(mirror), "diff", "--cached", "--quiet"]).returncode: - git("-C", str(mirror), "-c", "user.name=Logisim Revolution CI", - "-c", "user.email=ci@users.noreply.github.com", "commit", "--quiet", - "-m", f"Build snapshot of Gitea {sha}") + author_name = git_output("show", "-s", "--format=%an", sha) + author_email = git_output("show", "-s", "--format=%ae", sha) + if author_name == "Nils Briggen" and author_email == "nilsbriggen@gmail.com": + author_email = "88196754+NilsBriggen@users.noreply.github.com" + identity = os.environ.copy() + identity.update({ + "GIT_AUTHOR_NAME": author_name, + "GIT_AUTHOR_EMAIL": author_email, + "GIT_COMMITTER_NAME": author_name, + "GIT_COMMITTER_EMAIL": author_email, + }) + git("-C", str(mirror), "commit", "--quiet", + "-m", f"Build snapshot of Gitea {sha}", env=identity) mirror_sha = git_output("-C", str(mirror), "rev-parse", "HEAD") askpass = Path(temporary) / "askpass.sh" askpass.write_text(