Repository navigation
116 lines (99 loc) · 3.41 KB
/
Copy pathmisc.yml
File metadata and controls
116 lines (99 loc) · 3.41 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Pull Request Checks
on:
pull_request:
types: [opened, synchronize]
branches:
- main
concurrency:
group: pr-checks-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check-pr-commits:
name: Check PR Commits
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci --workspaces=false
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
editorconfig:
name: EditorConfig Check
if: github.event.action == 'opened' || github.event.action == 'synchronize'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Problem Matchers
run: echo "::add-matcher::${{ github.workspace }}/.github/matchers.json"
- name: Install EditorConfig CLI
uses: editorconfig-checker/action-editorconfig-checker@main
- name: Run EditorConfig Check
run: editorconfig-checker -format gcc
dco:
name: DCO Sign-off Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check DCO sign-off on all PR commits
run: |
MISSING=0
while IFS= read -r sha; do
msg=$(git log --format=%B -n 1 "$sha")
if ! echo "$msg" | grep -q "^Signed-off-by: "; then
echo "Missing Signed-off-by in commit $sha: $(git log --format=%s -n 1 $sha)"
MISSING=1
fi
done < <(git log --format=%H ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }})
if [ "$MISSING" -ne 0 ]; then
echo ""
echo "All commits must include a Signed-off-by line."
echo "Use 'git commit -s' or 'git rebase --signoff HEAD~N' to fix."
exit 1
fi
echo "All commits have DCO sign-off."
license:
name: License Check
if: github.event.action == 'opened' || github.event.action == 'synchronize'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get all relevant changed files
id: changed-files
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
with:
files: |
**.rs
**.ts
**.tsx
- name: Set up Go
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install addlicense
if: steps.changed-files.outputs.any_changed == 'true'
run: go install github.com/google/addlicense@latest
- name: Check Licenses
if: steps.changed-files.outputs.any_changed == 'true'
run: |
addlicense -check \
-ignore "*" -ignore "**/vite*" -ignore "**/tsup*" \
-v -c "The MOQtail Authors" \
${{ steps.changed-files.outputs.all_changed_files }}