Skip to content

Commit 963d356

Browse files
ci: Improvements on the mirror and prebuilt flow (commaai#386)
* Remove redundant git lfs pull command The `git lfs pull` command in the GitHub workflow is redundant and has been removed. Additionally, the `sync-lfs.sh` script has been updated to push all LFS objects to the origin repository. * using force push instead of trying to merge * Bumping ssh agent to 0.9.0 * Syntax --------- Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
1 parent 03f7619 commit 963d356

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

.github/workflows/mirror_to_gitlab.yaml

+3-12
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,18 @@ jobs:
2929
git config --global user.email 'action@github.com'
3030
3131
- name: Set up SSH
32-
uses: webfactory/ssh-agent@v0.5.3
32+
uses: webfactory/ssh-agent@v0.9.0
3333
with:
3434
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
3535

3636
- name: Add GitLab public keys
3737
run: |
3838
ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
3939
40+
# Note: If you have issues with "push rejected missing LFS" or something make sure you disabled LFS on the GITLAB repo if you intend to use a different LFS repo other than the target repo.
4041
- name: Sync and commit changes
4142
id: sync-and-commit
4243
run: |
43-
git lfs pull
44-
4544
# Add GitLab remote
4645
git remote add gitlab git@gitlab.com:sunnypilot/sunnyhaibin/sunnypilot-github-mirror.git
47-
48-
# Fetch from GitLab and check if the branch exists
49-
if git fetch gitlab ${{ github.ref }}; then
50-
# Merge changes from GitLab if the branch exists
51-
git merge gitlab/${{ github.ref_name }} --allow-unrelated-histories --strategy-option=theirs
52-
else
53-
echo "Branch does not exist on GitLab, skipping merge."
54-
fi
55-
git push -u gitlab ${{ github.ref }} # If you have issues with "push rejected missing LFS" or something. Make sure you disabled LFS on the GITLAB repo if you intend to use a different LFS repo other than the target repo
46+
git push -u --force gitlab ${{ github.ref }}

release/ci/sync-lfs.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ mv .lfsconfig-comma .lfsconfig
44
git lfs fetch --all; git lfs pull
55
mv .lfsconfig .lfsconfig-comma
66
mv .lfsconfig.bak .lfsconfig
7-
git lfs fetch --all; git lfs push origin main
7+
git lfs fetch --all; git lfs push --all origin

0 commit comments

Comments
 (0)