Skip to content

Commit 932df18

Browse files
authored
chore: change default branch from master to main (#396)
1 parent c935046 commit 932df18

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "Code Scanning"
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88

99
jobs:

.github/workflows/dev-image.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: 'Dev Image CI'
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
paths:
88
- '.github/workflows/dev-image.yml'
99
- '.dockerignore'
@@ -40,4 +40,4 @@ jobs:
4040
- run: make cirun cmd="npm ci"
4141
- run: make ciall
4242
- run: make push
43-
if: github.ref == 'refs/heads/master'
43+
if: github.ref == 'refs/heads/main'

.github/workflows/test.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: 'Test'
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
paths-ignore:
88
- '*.md'
99
pull_request:
@@ -72,26 +72,26 @@ jobs:
7272
run: npm run build
7373

7474
- name: Remove lint-staged husky
75-
if: github.ref == 'refs/heads/master'
75+
if: github.ref == 'refs/heads/main'
7676
run: |
7777
npm uninstall lint-staged husky
7878
git checkout package-lock.json package.json
7979
8080
- name: Setup mdBook
81-
if: github.ref == 'refs/heads/master'
81+
if: github.ref == 'refs/heads/main'
8282
uses: peaceiris/[email protected]
8383
with:
8484
mdbook-version: '0.3.7'
8585

8686
- name: Build site
87-
if: github.ref == 'refs/heads/master'
87+
if: github.ref == 'refs/heads/main'
8888
working-directory: ./test_projects/mdbook
8989
run: mdbook build
9090

9191
- name: Deploy
9292
if: |
9393
startsWith(matrix.os, 'ubuntu-18.04') &&
94-
github.ref == 'refs/heads/master'
94+
github.ref == 'refs/heads/main'
9595
uses: ./
9696
with:
9797
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -110,7 +110,7 @@ jobs:
110110
- name: Deploy
111111
if: |
112112
startsWith(matrix.os, 'ubuntu-16.04') &&
113-
github.ref == 'refs/heads/master'
113+
github.ref == 'refs/heads/main'
114114
uses: ./
115115
with:
116116
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -128,7 +128,7 @@ jobs:
128128
- name: Deploy
129129
if: |
130130
startsWith(matrix.os, 'macos') &&
131-
github.ref == 'refs/heads/master'
131+
github.ref == 'refs/heads/main'
132132
uses: ./
133133
with:
134134
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -147,7 +147,7 @@ jobs:
147147
- name: Deploy
148148
if: |
149149
startsWith(matrix.os, 'windows') &&
150-
github.ref == 'refs/heads/master'
150+
github.ref == 'refs/heads/main'
151151
uses: ./
152152
with:
153153
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
@@ -166,7 +166,7 @@ jobs:
166166
- name: Deploy
167167
if: |
168168
startsWith(matrix.os, 'ubuntu-20.04') &&
169-
github.ref == 'refs/heads/master'
169+
github.ref == 'refs/heads/main'
170170
uses: ./
171171
with:
172172
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}

release.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# fail on unset variables and command errors
44
set -eu -o pipefail # -x: is for debugging
55

6+
DEFAULT_BRANCH="main"
7+
68
CURRENT_BRANCH="$(git branch --show-current)"
7-
if [ "${CURRENT_BRANCH}" != "master" ]; then
8-
echo "$0: Current branch ${CURRENT_BRANCH} is not master, continue? (y/n)"
9+
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
10+
echo "$0: Current branch ${CURRENT_BRANCH} is not ${DEFAULT_BRANCH}, continue? (y/n)"
911
read -r res
1012
if [ "${res}" = "n" ]; then
1113
echo "$0: Stop script"
@@ -14,7 +16,7 @@ if [ "${CURRENT_BRANCH}" != "master" ]; then
1416
fi
1517

1618
PRERELEASE_TYPE_LIST="prerelease prepatch preminor premajor"
17-
if [ "${CURRENT_BRANCH}" != "master" ]; then
19+
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
1820
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST}"
1921
else
2022
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST} patch minor major"
@@ -37,10 +39,10 @@ if [ "${res}" = "n" ]; then
3739
fi
3840

3941
git fetch origin
40-
if [ "${CURRENT_BRANCH}" != "master" ]; then
42+
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
4143
git pull origin "${CURRENT_BRANCH}"
4244
else
43-
git pull origin master
45+
git pull origin ${DEFAULT_BRANCH}
4446
git tag -d v3 || true
4547
git pull origin --tags
4648
fi
@@ -58,10 +60,10 @@ git rm ./lib/index.js
5860
rm -rf ./lib
5961
git commit -m "chore(release): Remove build assets [skip ci]"
6062

61-
if [ "${CURRENT_BRANCH}" != "master" ]; then
63+
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
6264
git push origin "${CURRENT_BRANCH}"
6365
else
64-
git push origin master
66+
git push origin ${DEFAULT_BRANCH}
6567
fi
6668

6769
TAG_NAME="v$(jq -r '.version' ./package.json)"

0 commit comments

Comments
 (0)