-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 将用户邮箱从 "admin@icodeq.com" 修改为 "41898282+github-actions[bot]@users.noreply.github.com" - 将用户名从 "zkeq" 修改为 "github-actions[bot]"
- Loading branch information
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python3 | ||
import subprocess | ||
import os | ||
import re | ||
|
||
# 定义要匹配的提交信息模式 | ||
commit_pattern = r"GitHub Actions Crawler ALL IN ONE at \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}" | ||
|
||
# 创建环境变量设置命令 | ||
new_env = { | ||
'GIT_AUTHOR_NAME': 'github-actions[bot]', | ||
'GIT_AUTHOR_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com', | ||
'GIT_COMMITTER_NAME': 'github-actions[bot]', | ||
'GIT_COMMITTER_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com' | ||
} | ||
|
||
# 使用 git filter-branch | ||
cmd = ''' | ||
git filter-branch -f --env-filter ' | ||
COMMIT_MSG=$(git log --format=%B -n 1 $GIT_COMMIT) | ||
if [[ $COMMIT_MSG =~ "GitHub Actions Crawler ALL IN ONE at" ]]; then | ||
export GIT_AUTHOR_NAME="github-actions[bot]" | ||
export GIT_AUTHOR_EMAIL="41898282+github-actions[bot]@users.noreply.github.com" | ||
export GIT_COMMITTER_NAME="github-actions[bot]" | ||
export GIT_COMMITTER_EMAIL="41898282+github-actions[bot]@users.noreply.github.com" | ||
else | ||
export GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" | ||
export GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" | ||
export GIT_COMMITTER_NAME="$GIT_COMMITTER_NAME" | ||
export GIT_COMMITTER_EMAIL="$GIT_COMMITTER_EMAIL" | ||
fi | ||
' --tag-name-filter cat -- --all | ||
''' | ||
|
||
subprocess.run(cmd, shell=True) |