Skip to content

Commit

Permalink
yaml linting code
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Sep 19, 2024
1 parent 576f30d commit ed6b8ea
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,39 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout codegen repo
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
repository: xero-internal/xeroapi-sdk-codegen
path: xeroapi-sdk-codegen
python-version: '3.x'

- name: Install yaml lint
run: pip install yamllint

- name: Get list of changed files
id: changed_files
run: |
git fetch origin ${{github.base_ref}} --depth=1
git diff --name-only origin/${{github.base_ref}}...HEAD > changed_files.txt
grep -E '\.ya?ml$' changed_files.txt > yaml_files.txt || true
- name: Run yaml lint on changed files
run: |
if [ -s yaml_files.txt ]; then
echo "Linting the following yaml files:"
cat yaml_files.txt
xargs yamllint < yaml_files.txt
else
echo 'no yaml files changed'
fi
# - name: Checkout codegen repo
# uses: actions/checkout@v4
# with:
# repository: xero-internal/xeroapi-sdk-codegen
# path: xeroapi-sdk-codegen

# - name: Install octokit dependencies
# run: npm i
Expand Down
2 changes: 1 addition & 1 deletion xero_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ paths:
schema:
type: integer
maximum: 100
example: 50
example: 50000
- in: query
name: page
description: number of records to skip for pagination
Expand Down

0 comments on commit ed6b8ea

Please sign in to comment.