-
Notifications
You must be signed in to change notification settings - Fork 29
59 lines (59 loc) · 1.8 KB
/
Copy pathpr-checks.yml
File metadata and controls
59 lines (59 loc) · 1.8 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
---
name: PR checks
on:
pull_request:
push:
branches: [master, main, 'v?[0-9]+.[0-9]+']
jobs:
linting:
name: Check Yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install deps
run: |
pip install yamllint yamlfix
- name: Add yamllint annotator
uses: pr-annotators/yamllint-pr-annotator@v1.0.0
- name: Run yamllint
run: |-
yamllint -f parsable TranslatorReasonerAPI.yaml
format_check:
name: Check Yamlfix
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install deps
run: |
pip install yamllint yamlfix
- name: Run yamlfix
run: |-
yamlfix TranslatorReasonerAPI.yaml
- name: Verify no format changes
uses: tj-actions/verify-changed-files@v20.0.4
id: verify-changed-files
with:
files: |
TranslatorReasonerAPI.yaml
- name: Log diff after yamlfix
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |-
git diff --unified=0 TranslatorReasonerAPI.yaml
echo '::error::Yamlfix would make changes, see logs for details.'
exit 1