-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (59 loc) · 1.76 KB
/
verify.yaml
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
---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2023 The Linux Foundation
name: Lint GitHub Actions workflows
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download actionlint
id: get_actionlint
# yamllint disable-line rule:line-length
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash
commit-message:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Check PR for semantic commit message
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Requires the type to be capitlized, but accept any of the standard
# types
types: |
Fix
Feat
Chore
Docs
Style
Refactor
Perf
Test
Revert
CI
Build
validateSingleCommit: true
validateSingleCommitMatchesPrTitle: true
- name: Checkout code
uses: actions/checkout@v4
with:
# checkout at the last commit
ref: ${{ github.event.pull_request.head.sha }}
# get all history
fetch-depth: 0
- name: Install gitlint
shell: bash
run: |
python -m pip install gitlint
- name: Run gitlint
shell: bash
run: |
gitlint --commits "${{ github.event.pull_request.base.sha }}..HEAD"