-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.07 KB
/
lint-pr-message.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Linting PR description
on:
pull_request:
types: [opened, reopened, edited]
jobs:
lint-description:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: restore cache
id: cache
uses: actions/cache/restore@v4
with:
path: ~/.cargo/bin
key: commitlint
- name: install rust
if: steps.cache.outputs.cache-hit != 'true'
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
- name: compile binary
if: steps.cache.outputs.cache-hit != 'true'
run: |
cargo install commitlint-rs
- uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
key: commitlint
path: ~/.cargo/bin
- name: Lint message
env:
PR_NUMBER: ${{ github.event.number }}
GH_TOKEN: ${{ github.token }}
run: |
gh pr view $PR_NUMBER --json title,body --jq ".title,.body" > lint-message.txt
commitlint --edit lint-message.txt