From da2d5466d39aab034669dc2701c6cf17e25082d0 Mon Sep 17 00:00:00 2001 From: Shohei Ueda <30958501+peaceiris@users.noreply.github.com> Date: Fri, 17 Jul 2020 15:38:09 +0900 Subject: [PATCH] chore: change default branch from master to main (#386) --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/dev-image.yml | 2 +- .github/workflows/label-commenter.yml | 2 +- .github/workflows/test.yml | 2 +- README.md | 14 +++++++------- release.sh | 10 ++++++---- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 18b583a..348f329 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -3,7 +3,7 @@ name: "Code Scanning" on: push: branches: - - master + - main pull_request: jobs: diff --git a/.github/workflows/dev-image.yml b/.github/workflows/dev-image.yml index 2a27412..99a9cd8 100644 --- a/.github/workflows/dev-image.yml +++ b/.github/workflows/dev-image.yml @@ -3,7 +3,7 @@ name: 'Dev Image CI' on: push: branches: - - master + - main paths: - '.github/workflows/dev-image.yml' - '.dockerignore' diff --git a/.github/workflows/label-commenter.yml b/.github/workflows/label-commenter.yml index 3dfedad..b1363ec 100644 --- a/.github/workflows/label-commenter.yml +++ b/.github/workflows/label-commenter.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: master + ref: main - name: Label Commenter uses: peaceiris/actions-label-commenter@v1.3.7 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a03812..37d42d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: 'Test' on: push: branches: - - master + - main paths-ignore: - '**.md' pull_request: diff --git a/README.md b/README.md index eb45e65..4376e02 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -[![license](https://img.shields.io/github/license/peaceiris/actions-hugo.svg)](https://github.com/peaceiris/actions-hugo/blob/master/LICENSE) +[![license](https://img.shields.io/github/license/peaceiris/actions-hugo.svg)](https://github.com/peaceiris/actions-hugo/blob/main/LICENSE) [![release](https://img.shields.io/github/release/peaceiris/actions-hugo.svg)](https://github.com/peaceiris/actions-hugo/releases/latest) [![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-hugo.svg)](https://github.com/peaceiris/actions-hugo/releases) [![Release Feed](https://img.shields.io/badge/release-feed-yellow)](https://github.com/peaceiris/actions-hugo/releases.atom) -![Test](https://github.com/peaceiris/actions-hugo/workflows/Test/badge.svg?branch=master&event=push) +![Test](https://github.com/peaceiris/actions-hugo/workflows/Test/badge.svg?branch=main&event=push) [![CodeFactor](https://www.codefactor.io/repository/github/peaceiris/actions-hugo/badge)](https://www.codefactor.io/repository/github/peaceiris/actions-hugo) -[![codecov](https://codecov.io/gh/peaceiris/actions-hugo/branch/master/graph/badge.svg)](https://codecov.io/gh/peaceiris/actions-hugo) +[![codecov](https://codecov.io/gh/peaceiris/actions-hugo/branch/main/graph/badge.svg)](https://codecov.io/gh/peaceiris/actions-hugo) [![Maintainability](https://api.codeclimate.com/v1/badges/ebf2eef3a046b396ba9c/maintainability)](https://codeclimate.com/github/peaceiris/actions-hugo/maintainability) GitHub Actions for Hugo @@ -75,7 +75,7 @@ name: github pages on: push: branches: - - master + - main jobs: deploy: @@ -210,7 +210,7 @@ name: github pages on: push: branches: - - master + - main jobs: deploy: @@ -259,7 +259,7 @@ name: github pages on: push: branches: - - master + - main jobs: deploy: @@ -310,7 +310,7 @@ jobs: - [MIT License - peaceiris/actions-hugo] -[MIT License - peaceiris/actions-hugo]: https://github.com/peaceiris/actions-hugo/blob/master/LICENSE +[MIT License - peaceiris/actions-hugo]: https://github.com/peaceiris/actions-hugo/blob/main/LICENSE diff --git a/release.sh b/release.sh index f63a147..eb9efe0 100755 --- a/release.sh +++ b/release.sh @@ -3,8 +3,10 @@ # fail on unset variables and command errors set -eu -o pipefail # -x: is for debugging -if [ "$(git branch --show-current)" != "master" ]; then - echo "$0: Current branch is not master" 1>&2 +DEFAULT_BRANCH="main" + +if [ "$(git branch --show-current)" != "${DEFAULT_BRANCH}" ]; then + echo "$0: Current branch is not ${DEFAULT_BRANCH}" 1>&2 exit 1 fi @@ -26,7 +28,7 @@ if [ "${res}" = "n" ]; then fi git fetch origin -git pull origin master +git pull origin "${DEFAULT_BRANCH}" git tag -d v2 || true git pull origin --tags @@ -44,5 +46,5 @@ rm -rf ./lib git commit -m "chore(release): Remove build assets [skip ci]" TAG_NAME="v$(jq -r '.version' ./package.json)" -git push origin master +git push origin "${DEFAULT_BRANCH}" git push origin "${TAG_NAME}"