ci: update default branch

This commit is contained in:
Peter Evans 2021-05-12 17:12:31 +09:00
parent 041efd9199
commit 95dee52e1c
4 changed files with 10 additions and 10 deletions

View file

@ -1,12 +1,12 @@
name: CI name: CI
on: on:
push: push:
branches: [master] branches: [main]
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'docs/**' - 'docs/**'
pull_request: pull_request:
branches: [master] branches: [main]
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
- 'docs/**' - 'docs/**'
@ -76,7 +76,7 @@ jobs:
DOCKERHUB_REPOSITORY: peterevans/dd-ci-fixture-${{ matrix.target }} DOCKERHUB_REPOSITORY: peterevans/dd-ci-fixture-${{ matrix.target }}
package: package:
if: github.event_name == 'push' && github.ref == 'refs/heads/master' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [test] needs: [test]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -91,7 +91,7 @@ jobs:
commit-message: 'build: update distribution' commit-message: 'build: update distribution'
title: Update distribution title: Update distribution
body: | body: |
- Updates the distribution for changes on `master` - Updates the distribution for changes on `main`
Auto-generated by [create-pull-request][1] Auto-generated by [create-pull-request][1]

View file

@ -3,7 +3,7 @@ on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: branches:
- master - main
paths: paths:
- README.md - README.md
- .github/workflows/dockerhub-description.yml - .github/workflows/dockerhub-description.yml
@ -16,7 +16,7 @@ jobs:
- name: Modify readme for DockerHub - name: Modify readme for DockerHub
run: | run: |
sed -i 's/# Docker Hub Description/# [Docker Hub Description](https:\/\/github.com\/peter-evans\/dockerhub-description)/' README.md sed -i 's/# Docker Hub Description/# [Docker Hub Description](https:\/\/github.com\/peter-evans\/dockerhub-description)/' README.md
sed -i 's/(LICENSE)/(https:\/\/github.com\/peter-evans\/dockerhub-description\/blob\/master\/LICENSE)/' README.md sed -i 's/(LICENSE)/(https:\/\/github.com\/peter-evans\/dockerhub-description\/blob\/main\/LICENSE)/' README.md
- name: Docker Hub Description - name: Docker Hub Description
uses: ./ uses: ./

View file

@ -2,7 +2,7 @@ name: Publish Docker Image
on: on:
push: push:
branches: branches:
- master - main
tags: tags:
- v* - v*
env: env:
@ -25,7 +25,7 @@ jobs:
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention # Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest [ "$VERSION" == "main" ] && VERSION=latest
# Build and tag image # Build and tag image
docker build . --file Dockerfile --tag $IMAGE_NAME --label "org.opencontainers.image.version=$VERSION" docker build . --file Dockerfile --tag $IMAGE_NAME --label "org.opencontainers.image.version=$VERSION"

View file

@ -59,14 +59,14 @@ The GitHub repository description can be used for the Docker Hub `short-descript
### Examples ### Examples
The following workflow updates the Docker Hub repository description whenever there are changes to `README.md` and the workflow file itself on the `master` branch. This workflow assumes its location to be `.github/workflows/dockerhub-description.yml`. The following workflow updates the Docker Hub repository description whenever there are changes to `README.md` and the workflow file itself on the `main` branch. This workflow assumes its location to be `.github/workflows/dockerhub-description.yml`.
```yml ```yml
name: Update Docker Hub Description name: Update Docker Hub Description
on: on:
push: push:
branches: branches:
- master - main
paths: paths:
- README.md - README.md
- .github/workflows/dockerhub-description.yml - .github/workflows/dockerhub-description.yml