File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Re-author
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ previous_email :
6+ required : true
7+ description : ' Author to change (email)'
8+ type : string
9+ new_email :
10+ required : true
11+ description : ' New author email'
12+ type : string
13+ new_username :
14+ required : true
15+ description : ' New author username'
16+ type : string
17+
18+ jobs :
19+ reauthor :
20+ name : Re-author job
21+ runs-on : ubuntu-latest
22+ steps :
23+ - name : Set-up SSH
24+ uses : MrSquaare/ssh-setup-action@v1
25+ with :
26+ host : github.com
27+ private-key : ${{ secrets.DEPLOY_KEY }}
28+ - name : Clone and Re-author
29+ run : |
30+ git clone --bare git@github.com:ChainSafe/web3.unity.git
31+
32+ cd web3.unity.git
33+
34+ git config user.email "$new_email"
35+
36+ git config user.name $new_username
37+
38+ #!/bin/sh
39+
40+ git filter-branch -f --env-filter '
41+ OLD_EMAIL="$previous_email"
42+ CORRECT_NAME="$new_username"
43+ CORRECT_EMAIL="$new_email"
44+ if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
45+ then
46+ export GIT_COMMITTER_NAME="$CORRECT_NAME"
47+ export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
48+ fi
49+ if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
50+ then
51+ export GIT_AUTHOR_NAME="$CORRECT_NAME"
52+ export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
53+ fi
54+ ' --tag-name-filter cat -- --branches --tags
55+ git push --force --tags origin 'refs/heads/*'
56+ env :
57+ previous_email : ${{ github.event.inputs.previous_email }}
58+ new_email : ${{ github.event.inputs.new_email }}
59+ new_username : ${{ github.event.inputs.new_username }}
You can’t perform that action at this time.
0 commit comments