Skip to content

Commit 7381983

Browse files
author
gongchandang49
committed
Update gh action
1 parent 7961a69 commit 7381983

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,28 @@ jobs:
1818
sync:
1919
runs-on: ubuntu-latest
2020

21+
env:
22+
CBERG_HTTPS: https://codeberg.org/gongchandang49/bypass-all-shortlinks-debloated.git
23+
CBERG_BRANCH: main
24+
GH_BRANCH: main
25+
GIT_USER: "gongchandang49"
26+
GIT_EMAIL: "gongchandang49@noreply.codeberg.org"
27+
2128
steps:
2229
- name: Checkout GitHub repository
23-
uses: actions/checkout@v2
30+
uses: actions/checkout@v6
2431

2532
- name: Configure Git
2633
run: |
27-
git config --global user.name "gongchandang49"
28-
git config --global user.email "170948611+gongchandang49@users.noreply.github.com"
34+
git config --global user.name ${GIT_USER}
35+
git config --global user.email ${GIT_EMAIL}
2936
- name: Pull from Codeberg
3037
run: |
31-
git remote add codeberg https://codeberg.org/gongchandang49/bypass-all-shortlinks-debloated.git
32-
git fetch codeberg
33-
git checkout main
34-
git reset --hard codeberg/main
35-
36-
sudo apt-get update > /dev/null 2>&1
37-
sudo apt-get install git-filter-repo > /dev/null 2>&1
38-
git filter-repo --email-callback '
39-
return email if email != b"gongchandang49@noreply.codeberg.org" else b"170948611+gongchandang49@users.noreply.github.com"
40-
' --force
41-
git remote add origin https://github.com/${{ github.repository }}.git
38+
git remote remove codeberg || true
39+
git remote add codeberg "${CBERG_HTTPS}"
40+
git fetch --prune codeberg "${CBERG_BRANCH}"
41+
git switch -C "${GH_BRANCH}" "codeberg/${CBERG_BRANCH}"
42+
git checkout -f "${GH_BRANCH}"
4243
- name: Push changes to GitHub
4344
run: |
44-
git push --force origin main
45+
git push --force origin "${GH_BRANCH}"

0 commit comments

Comments
 (0)