Skip to content

Commit

Permalink
Default branch rename
Browse files Browse the repository at this point in the history
Helps with whatwg/meta#174.
  • Loading branch information
annevk committed Jan 15, 2021
1 parent 9c7441d commit 4a2dc77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Build
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
jobs:
build:
name: Build
Expand Down Expand Up @@ -34,13 +34,13 @@ jobs:
mkdir output
bash ci-build/docker-run.sh "$GITHUB_WORKSPACE/html" output
- name: Docker login
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker push
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
docker tag "$IMAGE_NAME" "$IMAGE_NAME:$GITHUB_SHA"
docker tag "$IMAGE_NAME" "$IMAGE_NAME:latest"
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function checkHTMLBuildIsUpToDate {
fi
# TODO: `git remote get-url origin` is nicer, but new in Git 2.7.
ORIGIN_URL=$(git config --get remote.origin.url)
GIT_FETCH_ARGS+=( "$ORIGIN_URL" master)
GIT_FETCH_ARGS+=( "$ORIGIN_URL" main)
git fetch "${GIT_FETCH_ARGS[@]}"
NEW_COMMITS=$(git rev-list --count HEAD..FETCH_HEAD)
if [[ $NEW_COMMITS != "0" ]]; then
Expand All @@ -203,7 +203,7 @@ function checkHTMLBuildIsUpToDate {
echo
echo "To update, run this command:"
echo
echo " git pull --rebase origin master"
echo " git pull --rebase origin main"
echo
echo "This check can be bypassed with the --no-update option."
exit 1
Expand Down

0 comments on commit 4a2dc77

Please sign in to comment.