forked from nubificus/urunc
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (96 loc) · 3.1 KB
/
validate-files-and-commits.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
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
name: Validate Files and Commit Messages
on:
workflow_call:
inputs:
actions-repo:
type: string
default: 'nubificus/vaccel'
actions-rev:
type: string
default: 'main'
runner:
type: string
default: '["gcc", "dind", "2204"]'
runner-archs:
type: string
default: '["amd64"]'
runner-arch-map:
type: string
default: '[{"amd64":"x86_64", "arm64":"aarch64", "arm":"armv7l"}]'
secrets:
GIT_CLONE_PAT:
required: false
jobs:
linter-commitlint:
name: Lint Commit Messages
runs-on: ${{ format('{0}-{1}', join(fromJSON(inputs.runner), '-'), matrix.arch) }}
strategy:
matrix:
arch: ["${{ fromJSON(inputs.runner-archs) }}"]
fail-fast: false
steps:
- name: Checkout .github directory
uses: actions/checkout@v4
with:
sparse-checkout: .github
repository: ${{ inputs.actions-repo }}
ref: ${{ inputs.actions-rev }}
- name: Initialize workspace
uses: ./.github/actions/initialize-workspace
with:
submodules: 'false'
remote-actions-repo: ${{ inputs.actions-repo }}
token: ${{ secrets.GIT_CLONE_PAT || github.token }}
- name: Run commitlint
uses: wagoid/commitlint-github-action@v6
with:
configFile: .github/linters/commitlint.config.mjs
linter-typos:
name: Spell Check Repo
runs-on: ${{ format('{0}-{1}', join(fromJSON(inputs.runner), '-'), matrix.arch) }}
strategy:
matrix:
arch: ["${{ fromJSON(inputs.runner-archs) }}"]
fail-fast: false
steps:
- name: Checkout .github directory
uses: actions/checkout@v4
with:
sparse-checkout: .github
repository: ${{ inputs.actions-repo }}
ref: ${{ inputs.actions-rev }}
- name: Initialize workspace
uses: ./.github/actions/initialize-workspace
with:
submodules: 'false'
remote-actions-repo: ${{ inputs.actions-repo }}
token: ${{ secrets.GIT_CLONE_PAT || github.token }}
- name: Spell check
uses: crate-ci/typos@master
with:
config: .github/linters/typos.toml
linter-license-eye:
name: Check License Headers
runs-on: ${{ format('{0}-{1}', join(fromJSON(inputs.runner), '-'), matrix.arch) }}
strategy:
matrix:
arch: ["${{ fromJSON(inputs.runner-archs) }}"]
fail-fast: false
steps:
- name: Checkout .github directory
uses: actions/checkout@v4
with:
sparse-checkout: .github
repository: ${{ inputs.actions-repo }}
ref: ${{ inputs.actions-rev }}
- name: Initialize workspace
uses: ./.github/actions/initialize-workspace
with:
submodules: 'false'
remote-actions-repo: ${{ inputs.actions-repo }}
token: ${{ secrets.GIT_CLONE_PAT || github.token }}
- name: Run license-eye
uses: apache/skywalking-eyes/header@main
with:
config: .github/linters/licenserc.yml
token: ${{ secrets.GITHUB_TOKEN }}