Skip to content

Commit ed6b8ea

Browse files
author
sangeet-joy_xero
committed
yaml linting code
1 parent 576f30d commit ed6b8ea

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

.github/workflows/pr.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,39 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Checkout codegen repo
13+
- name: Checkout Repository
1414
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
1518
with:
16-
repository: xero-internal/xeroapi-sdk-codegen
17-
path: xeroapi-sdk-codegen
19+
python-version: '3.x'
20+
21+
- name: Install yaml lint
22+
run: pip install yamllint
23+
24+
- name: Get list of changed files
25+
id: changed_files
26+
run: |
27+
git fetch origin ${{github.base_ref}} --depth=1
28+
git diff --name-only origin/${{github.base_ref}}...HEAD > changed_files.txt
29+
grep -E '\.ya?ml$' changed_files.txt > yaml_files.txt || true
30+
31+
- name: Run yaml lint on changed files
32+
run: |
33+
if [ -s yaml_files.txt ]; then
34+
echo "Linting the following yaml files:"
35+
cat yaml_files.txt
36+
xargs yamllint < yaml_files.txt
37+
else
38+
echo 'no yaml files changed'
39+
fi
40+
41+
# - name: Checkout codegen repo
42+
# uses: actions/checkout@v4
43+
# with:
44+
# repository: xero-internal/xeroapi-sdk-codegen
45+
# path: xeroapi-sdk-codegen
1846

1947
# - name: Install octokit dependencies
2048
# run: npm i

xero_files.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ paths:
3232
schema:
3333
type: integer
3434
maximum: 100
35-
example: 50
35+
example: 50000
3636
- in: query
3737
name: page
3838
description: number of records to skip for pagination

0 commit comments

Comments
 (0)