Skip to content

Commit 86aef7c

Browse files
committed
ci: mirror main branch to GitLab
1 parent 09a5f03 commit 86aef7c

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Mirror to GitLab
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
mirror:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Push to GitLab
16+
env:
17+
GITLAB_TOKEN: ${{ secrets.GITLAB_MIRROR_TOKEN }}
18+
run: |
19+
REPO_NAME="${GITHUB_REPOSITORY#*/}"
20+
if [ "$REPO_NAME" = ".github" ]; then
21+
GITLAB_REPO="enterprise-ai-atlas-github"
22+
else
23+
GITLAB_REPO="$REPO_NAME"
24+
fi
25+
git remote add gitlab "https://oauth2:${GITLAB_TOKEN}@gitlab.com/andrew_white/${GITLAB_REPO}.git"
26+
git push gitlab main --force

0 commit comments

Comments
 (0)