Merge branch 'main' into renovate/ghcr.io-n8n-io-n8n-1.x
All checks were successful
Lint on PR / Lint YAML files (pull_request) Successful in 4s
All checks were successful
Lint on PR / Lint YAML files (pull_request) Successful in 4s
This commit is contained in:
commit
edc7ccc53a
1 changed files with 11 additions and 17 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
name: Lint on PR
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
|
@ -12,23 +14,15 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get modified YAML files
|
- name: Debug Repository Contents
|
||||||
id: get_changed_files
|
|
||||||
run: |
|
run: |
|
||||||
if git rev-parse --verify HEAD^ >/dev/null 2>&1; then
|
pwd
|
||||||
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD | grep -E '\.(yml)$' || true)
|
ls -R
|
||||||
else
|
|
||||||
CHANGED_FILES=$(git diff --name-only $(git hash-object -t tree /dev/null) HEAD | grep -E '\.(yml)$' || true)
|
|
||||||
fi
|
|
||||||
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Run yamllint on modified files
|
- name: Show yamllint version
|
||||||
if: env.CHANGED_FILES != ''
|
run: |
|
||||||
run: |
|
yamllint --version
|
||||||
yamllint $CHANGED_FILES
|
|
||||||
env:
|
|
||||||
CHANGED_FILES: ${{ env.CHANGED_FILES }}
|
|
||||||
|
|
||||||
- name: Skip linting if no YAML files are changed
|
- name: Lint .yml files
|
||||||
if: env.CHANGED_FILES == ''
|
run: |
|
||||||
run: echo "No YAML files changed in this PR. Skipping lint."
|
yamllint -d docker/**/*.yml
|
||||||
|
|
Loading…
Reference in a new issue