Skip to content

Commit 12bc74b

Browse files
committed
Use 'main' instead of 'master'
1 parent 9859c78 commit 12bc74b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

scripts/create.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const originalUrl = `https://github.com/${owner}/${repository}.git`;
6767

6868
const newRepoName = `${langCode}.${repository}`;
6969
const newRepoUrl = `https://github.com/${owner}/${newRepoName}.git`;
70-
const defaultBranch = 'master';
70+
const defaultBranch = 'main';
7171

7272
const token = process.env.GITHUB_ADMIN_ACCESS_TOKEN;
7373
const octokit = new Octokit({

scripts/sync.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const username = process.env.USER_NAME;
2929
const token = process.env.GITHUB_ACCESS_TOKEN;
3030
const transRepoName = `${langCode}.${repository}`;
3131
const transUrl = `https://${username}:${token}@github.com/${owner}/${transRepoName}.git`;
32-
const defaultBranch = 'master';
32+
const defaultBranch = 'main';
3333

3434
function teardownAndExit() {
3535
if (program.delete) {
@@ -74,7 +74,7 @@ if (shell.exec(`git checkout ${syncBranch}`).code !== 0) {
7474
shell.exec(`git checkout -b ${syncBranch}`);
7575
}
7676

77-
// Pull from {source}/master
77+
// Pull from {source}/main
7878
const output = shell.exec(`git pull ${repository} ${defaultBranch}`).stdout;
7979
if (output.includes('Already up to date.')) {
8080
logger.info(`We are already up to date with ${repository}.`);
@@ -90,9 +90,9 @@ const conflictFiles = conflictLines.map(line =>
9090

9191
shell.exec(`git commit -am "merging all conflicts"`);
9292

93-
// If no conflicts, merge directly into master
93+
// If no conflicts, merge directly into main
9494
if (conflictFiles.length === 0) {
95-
logger.info('No conflicts found. Committing directly to master.');
95+
logger.info('No conflicts found. Committing directly to main.');
9696
shell.exec(`git checkout ${defaultBranch}`);
9797
shell.exec(`git merge ${syncBranch}`);
9898
shell.exec(`git push origin ${defaultBranch}`);
@@ -112,7 +112,7 @@ The following files have conflicts and may need new translations:
112112
${conflictFiles
113113
.map(
114114
file =>
115-
` * [ ] [${file}](/${owner}/${repository}/commits/master/${file})`,
115+
` * [ ] [${file}](/${owner}/${repository}/commits/main/${file})`,
116116
)
117117
.join('\n')}
118118
@@ -122,13 +122,13 @@ Please fix the conflicts by pushing new commits to this pull request, either by
122122
const body = `
123123
This PR was automatically generated.
124124
125-
Merge changes from [reactjs.org](https://github.com/reactjs/reactjs.org/commits/master) at ${shortHash}
125+
Merge changes from [reactjs.org](https://github.com/reactjs/reactjs.org/commits/main) at ${shortHash}
126126
127127
${conflictFiles.length > 0 ? conflictsText : 'No conflicts were found.'}
128128
129129
## DO NOT SQUASH MERGE THIS PULL REQUEST!
130130
131-
Doing so will "erase" the commits from master and cause them to show up as conflicts the next time we merge.
131+
Doing so will "erase" the commits from main and cause them to show up as conflicts the next time we merge.
132132
`;
133133

134134
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_integer_between_two_values

0 commit comments

Comments
 (0)