Skip to content

Commit

Permalink
chore: change default branch from master to main (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris authored Jul 17, 2020
1 parent 71f80af commit da2d546
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Code Scanning"
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 'Dev Image CI'
on:
push:
branches:
- master
- main
paths:
- '.github/workflows/dev-image.yml'
- '.dockerignore'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: master
ref: main

- name: Label Commenter
uses: peaceiris/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 'Test'
on:
push:
branches:
- master
- main
paths-ignore:
- '**.md'
pull_request:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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">
Expand Down Expand Up @@ -75,7 +75,7 @@ name: github pages
on:
push:
branches:
- master
- main

jobs:
deploy:
Expand Down Expand Up @@ -210,7 +210,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
Expand Down Expand Up @@ -259,7 +259,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
Expand Down Expand Up @@ -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



Expand Down
10 changes: 6 additions & 4 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

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

0 comments on commit da2d546

Please sign in to comment.