因为仓库比较多(比较懒),不想每次都手动发布版本,写项目版本更新的内容,因此给自己的每一个仓库引入了 googleapis/release-please-action
在仓库的根目录新建文件:.github/workflows/release-please.yml
on:
push:
branches:
- master
permissions:
issues: write
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: $
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: simple
然后,给仓库的 Github Action 添加权限,勾选 “Allow GitHub Actions to create and approve pull requests”,在仓库的 Settings > Actions > General。
完成以上步骤以后,书写 Git commit 时,需要遵循 Conventional Commits。