Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/commitlint.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/lint_pr_title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Lint PR title"

on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
lint_pr_title:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install commitlint
run: npm install @commitlint/cli @commitlint/config-conventional

- name: Get current PR title
id: get_title
uses: actions/github-script@v6
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
return pr.data.title;

- name: Lint PR title
run: |
echo "${{ steps.get_title.outputs.result }}" > pr_title.txt
npx commitlint --edit pr_title.txt --config commitlint.config.js
Loading