Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fengzch-das
nunchaku
Commits
1f5e03cc
Commit
1f5e03cc
authored
Apr 24, 2025
by
Muyang Li
Browse files
[Auto Merge] chore: fix the authors of the sync commit (#314)
parents
c90cc22f
fa765637
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
.github/workflows/auto-merge-main-into-dev.yml
.github/workflows/auto-merge-main-into-dev.yml
+11
-8
.github/workflows/sync-to-private.yml
.github/workflows/sync-to-private.yml
+4
-5
No files found.
.github/workflows/auto-merge-main-into-dev.yml
View file @
1f5e03cc
...
...
@@ -15,11 +15,6 @@ jobs:
if
:
github.repository == 'mit-han-lab/nunchaku'
steps
:
-
name
:
Set up Git User
run
:
|
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
-
name
:
Checkout the repository
uses
:
actions/checkout@v4
with
:
...
...
@@ -45,11 +40,19 @@ jobs:
-
name
:
Merge main into dev
id
:
last_commit
if
:
steps.check_sync.outputs.skip_merge == 'false'
run
:
|
git fetch origin main
run
:
|
# Get author name and email from last commit on main
AUTHOR_NAME=$(git log origin/main -1 --pretty=format:'%an')
AUTHOR_EMAIL=$(git log origin/main -1 --pretty=format:'%ae')
LAST_MSG=$(git log origin/main -1 --pretty=%s)
echo "Author: $AUTHOR_NAME <$AUTHOR_EMAIL>"
echo "Last commit message: $LAST_MSG"
set -e
# Set Git user to last author
git config --global user.name "$AUTHOR_NAME"
git config --global user.email "$AUTHOR_EMAIL"
git checkout dev
git merge origin/main -m "[Auto Merge] $LAST_MSG"
git push origin dev
.github/workflows/sync-to-private.yml
View file @
1f5e03cc
...
...
@@ -15,11 +15,6 @@ jobs:
if
:
github.repository == 'mit-han-lab/nunchaku'
steps
:
-
name
:
Set up Git User
run
:
|
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
-
name
:
Clone private repository
run
:
|
git clone https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/mit-han-lab/nunchaku-dev.git
...
...
@@ -53,6 +48,10 @@ jobs:
# Preserve original author and amend commit message
GIT_AUTHOR_NAME=$(git log --format='%aN' -n 1 $COMMIT)
GIT_AUTHOR_EMAIL=$(git log --format='%aE' -n 1 $COMMIT)
git config --global user.name "$GIT_AUTHOR_NAME"
git config --global user.email "$GIT_AUTHOR_EMAIL"
NEW_MSG="[Auto Sync] ${COMMIT_MSG}"
PARENTS=$(git rev-list --parents -n 1 $COMMIT)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment