Skip to content

Commit bd5c094

Browse files
authored
build: preparation for primary branch rename in the Angular repos (#24783)
Preparation for the components repo as outlined our planning document.
1 parent bc2fddb commit bd5c094

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

.circleci/config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ var_13: &attach_release_output
8383
var_14: &publish_branches_filter
8484
branches:
8585
only:
86+
- main
87+
# TODO(BRANCH_RENAME_CLEANUP): remove
8688
- master
8789
# 6.0.x, 7.1.x, etc.
8890
- /\d+\.\d+\.x/
@@ -134,6 +136,8 @@ var_20: &slack_notify_on_failure
134136
var_21: &only_main_branch_filter
135137
branches:
136138
only:
139+
- main
140+
# TODO(BRANCH_RENAME_CLEANUP): remove
137141
- master
138142

139143
# -----------------------------
@@ -668,7 +672,9 @@ workflows:
668672
filters:
669673
branches:
670674
only:
671-
# We only want to run the "master" branch against the snapshot builds because
675+
# We only want to run the main branch against the snapshot builds because
672676
# it's not guaranteed that older versions of Angular Material always work
673677
# with the latest Angular version.
678+
- main
679+
# TODO(BRANCH_RENAME_CLEANUP): remove
674680
- master

.circleci/rebase-pr.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,31 @@ async function _main() {
9797
/**
9898
* Sort a list of fullpath refs into a list and then provide the first entry.
9999
*
100-
* The sort order will first find master ref, and then any semver ref, followed
100+
* The sort order will first find main branch, and then any semver ref, followed
101101
* by the rest of the refs in the order provided.
102102
*
103-
* Branches are sorted in this order as work is primarily done on master, and
104-
* otherwise on a semver branch. If neither of those were to match, the most
103+
* Branches are sorted in this order as work is primarily done on main branches,
104+
* and otherwise on a semver branch. If neither of those were to match, the most
105105
* likely correct branch will be the first one encountered in the list.
106106
*/
107107
function getRefFromBranchList(gitOutput) {
108108
const branches = gitOutput.split('\n').map(b => b.split('/').slice(1).join('').trim());
109109
return branches.sort((a, b) => {
110+
if (a === 'main') {
111+
return -1;
112+
}
113+
if (b === 'main') {
114+
return 1;
115+
}
116+
117+
// TODO(BRANCH_RENAME_CLEANUP): remove
110118
if (a === 'master') {
111119
return -1;
112120
}
113121
if (b === 'master') {
114122
return 1;
115123
}
124+
116125
const aIsSemver = semverRegex.test(a);
117126
const bIsSemver = semverRegex.test(b);
118127
if (aIsSemver && bIsSemver) {

.github/workflows/scorecard.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ on:
44
schedule:
55
- cron: '0 3 * * 0'
66
push:
7-
branches: [master]
7+
branches: [
8+
main,
9+
# TODO(BRANCH_RENAME_CLEANUP): remove
10+
master,
11+
]
812
workflow_dispatch:
913

1014
# Declare default permissions as read only.

0 commit comments

Comments
 (0)