Skip to content

Commit bcaa2cf

Browse files
committed
Sync project branch improvements
The repository appears to be initially created as a shallow clone. We need both branches in order to merge between two branches. Fetch the remote repository with the unshallow option. If that command fails, then fetch the remote repository without the unshallow option. The hope is that one of the two fetch commands will succeed. Configure the user email address and user name in the repository so that the merge does not fail with the message that user name and user email are not configured. The email address is fake, since no email is accepted at the jenkins.io site. Perform the merge with the `--no-edit` command so that merge knows it should not open an editor. May be unnecessary, but should not be harmful.
1 parent a0aadc2 commit bcaa2cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/sync-project-branch.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ jobs:
1212
with:
1313
ref: gsoc-2023-project
1414
- run: |
15-
git fetch --unshallow origin
16-
git merge origin/master
15+
git fetch --unshallow origin || git fetch origin
16+
git config user.email "[email protected]"
17+
git config user.name "Sync project branch action"
18+
git merge --no-edit origin/master
1719
- uses: peter-evans/create-pull-request@v5
1820
with:
1921
title: Merge remote-tracking branch `origin/master` into `gsoc-2023-project`

0 commit comments

Comments
 (0)