You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ti...@apache.org on 2022/12/03 07:27:05 UTC

[pulsar-site] branch main updated: Docs sync done from apache/pulsar (#3df506de09)

This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 59dd31990c3 Docs sync done from apache/pulsar (#3df506de09)
59dd31990c3 is described below

commit 59dd31990c36a8fc7f8ce8daeb6b4325dbfa8c53
Author: tison <wa...@gmail.com>
AuthorDate: Sat Dec 3 15:26:19 2022 +0800

    Docs sync done from apache/pulsar (#3df506de09)
---
 tools/pytools/bin/site-updater.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/pytools/bin/site-updater.py b/tools/pytools/bin/site-updater.py
index a4492e4731b..be56eb82bd1 100755
--- a/tools/pytools/bin/site-updater.py
+++ b/tools/pytools/bin/site-updater.py
@@ -57,11 +57,18 @@ def _do_push(main: Path, site: Path):
     run(_git, 'status', cwd=site)
     run(_git, 'remote', '-v', cwd=site)
     if os.getenv('GITHUB_ACTIONS') is not None:
-        name = os.getenv('GITHUB_ACTOR') or 'Pulsar Site Updater'
+        if os.getenv('GITHUB_EVENT_NAME') != 'schedule':
+            name = os.getenv('GITHUB_ACTOR')
+            email = f'{name}@users.noreply.github.com'
+        else:
+            name = 'github-actions[bot]'
+            email = f'41898282+{name}@users.noreply.github.com'
         run(_git, 'config', 'user.name', name, cwd=site)
-        run(_git, 'config', 'user.email', f"{name}@users.noreply.github.com", cwd=site)
-    run(_git, 'commit', '--allow-empty', '-m', f'Docs sync done from apache/pulsar (#{commit})', cwd=site)
-    run(_git, 'push', 'origin', 'main', cwd=site)
+        run(_git, 'config', 'user.email', email, cwd=site)
+    changed = run_pipe(_git, 'status', '--porcelain', cwd=site).read().strip()
+    if len(changed) != 0:
+        run(_git, 'commit', '-m', f'Docs sync done from apache/pulsar (#{commit})', cwd=site)
+        run(_git, 'push', 'origin', 'main', cwd=site)
 
 
 if __name__ == '__main__':