-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.03 KB
/
lint-pr-title.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
39
40
name: Lint Pull Request Title
on:
pull_request_target:
types:
- opened
- edited
- synchronize
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate scopes from folder structure
id: generate-scopes
run: |
scopes=$(ls -d ./crates/*/ | xargs -n1 basename)
# Add additional scopes here:
scopes+=$'\n'ci
scopes+=$'\n'docs
echo "scopes<<EOF" >> $GITHUB_OUTPUT
echo "$scopes" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
with:
scopes: ${{ steps.generate-scopes.outputs.scopes }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}