chore: change default branch from master to main (#386)

This commit is contained in:
Shohei Ueda 2020-07-17 15:38:09 +09:00 committed by GitHub
parent 71f80aff9f
commit da2d5466d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 15 deletions

View File

@ -3,7 +3,7 @@ name: "Code Scanning"
on:
push:
branches:
- master
- main
pull_request:
jobs:

View File

@ -3,7 +3,7 @@ name: 'Dev Image CI'
on:
push:
branches:
- master
- main
paths:
- '.github/workflows/dev-image.yml'
- '.dockerignore'

View File

@ -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

View File

@ -3,7 +3,7 @@ name: 'Test'
on:
push:
branches:
- master
- main
paths-ignore:
- '**.md'
pull_request:

View File

@ -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)
<img width="400" alt="GitHub Actions for Hugo" src="./images/ogp.svg">
@ -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

View File

@ -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}"