Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sync-branches.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions workflows/sync-branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ steps:
return { returncode: result.status, stdout: result.stdout || '', stderr: result.stderr || '' };
}

// List all remote branches matching the autoloop/* pattern
const listResult = git('branch', '-r', '--list', 'origin/autoloop/*');
// Discover all remote branches matching the autoloop/* pattern.
// Use ls-remote instead of 'git branch -r' so we don't depend on
// pre-fetched remote-tracking refs (shallow checkouts won't have them).
const listResult = git('ls-remote', '--heads', 'origin', 'autoloop/*');
if (listResult.returncode !== 0) {
console.log('Failed to list remote branches: ' + listResult.stderr);
process.exit(0);
Expand All @@ -44,7 +46,7 @@ steps:
const branches = listResult.stdout.trim().split('\n')
.map(b => b.trim())
.filter(b => b)
.map(b => b.replace('origin/', ''));
.map(b => b.replace(/^.*refs\/heads\//, ''));

if (branches.length === 0) {
console.log('No autoloop/* branches found. Nothing to sync.');
Expand Down
Loading