Skip to content
Open
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
14 changes: 12 additions & 2 deletions scripts/sync-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,19 @@ async function syncContentWithUpstream(languageCode) {
await exec(`git commit -am "merging all conflicts"`, options);
}

// Create a new pull request, listing all conflicting files
await exec(`git push --set-upstream --force origin ${syncBranch}`, options);
try {
await exec(`git push --set-upstream origin ${syncBranch}`, options);
} catch (error) {
// If push fails, it is likely because the remote has been already
// updated by a human contributor.
console.log(
`Push to origin/${syncBranch} failed (likely due to remote updates by human contributors).\n` +
`Error: ${error.message}`
);
return;
}

// Create a new pull request, listing all conflicting files
const title = `Sync with ${MAIN_REPOSITORY_NAME} @ ${shortHash}`;

let conflictsText = '';
Expand Down