mirror of
https://github.com/voson-wang/toon.git
synced 2026-01-29 15:24:10 +08:00
* ci: automate PR title linting This will help with Squash & Merge when you need the squashed commit to have the correct Conventional Commits format so that it can be parsed when generating release notes (With Squash & Merge the squashed commit message is taken from the PR title) * chore: minor updates --------- Co-authored-by: Johann Schopplich <mail@johannschopplich.com>
37 lines
976 B
YAML
37 lines
976 B
YAML
name: Check PR Title
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, edited]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint-pr-title:
|
|
name: Lint PR title
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ (github.event.action == 'opened' || github.event.changes.title != null) && github.actor != 'renovate[bot]' }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
# Only fetch the config file from the repository
|
|
sparse-checkout-cone-mode: false
|
|
sparse-checkout: commitlint.config.ts
|
|
|
|
- name: Install dependencies
|
|
run: npm install -D @commitlint/cli @commitlint/config-conventional
|
|
|
|
- name: Validate PR title with commitlint
|
|
run: echo "$PR_TITLE" | npx commitlint
|
|
env:
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|