-
Notifications
You must be signed in to change notification settings - Fork 65
44 lines (39 loc) · 1.13 KB
/
pr-title-spell-check.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
41
42
43
44
name: PR Validations
on:
merge_group:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
typos:
name: Spell check PR title
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Store PR title in a file
shell: bash
env:
TITLE: ${{ github.event.pull_request.title }}
run: echo $TITLE > pr_title.txt
- name: Spell check
uses: crate-ci/typos@master
with:
files: ./pr_title.txt
check-assignee:
name: Check Assignee
runs-on: ubuntu-latest
steps:
- name: Check if assignee is added
uses: actions/github-script@v6
with:
script: |
const assignees = context.payload.issue ? context.payload.issue.assignees : context.payload.pull_request.assignees;
console.log("Assignees:", assignees);
if (assignees.length === 0) {
throw new Error('No assignee added. Please add an assignee to this issue or pull request.');
} else {
console.log("Assignee check passed.");
}