File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Sync to GitLab
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ schedule :
8
+ - cron : " 0 2 * * *" # Optional: Runs daily at 2 AM UTC
9
+
10
+ jobs :
11
+ sync :
12
+ runs-on : ubuntu-latest
13
+
14
+ steps :
15
+ - name : Checkout the repository
16
+ uses : actions/checkout@v3
17
+
18
+ - name : Configure Git
19
+ run : |
20
+ git config --global user.name "github-actions[bot]"
21
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
22
+
23
+ - name : Add GitLab as remote
24
+ run : |
25
+ git remote add gitlab "${{ secrets.GITLAB_URL }}/${{ secrets.GITLAB_NAMESPACE }}/$GITHUB_REPOSITORY.git"
26
+
27
+ - name : Push to GitLab
28
+ env :
29
+ GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
30
+ run : |
31
+ git push --mirror "https://oauth2:${GITLAB_TOKEN}@${{ secrets.GITLAB_URL }}/${{ secrets.GITLAB_NAMESPACE }}/$GITHUB_REPOSITORY.git"
You can’t perform that action at this time.
0 commit comments