Merge pull request #65 from Kikkah070/V-는-바람에 #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
lint-changed-yaml: | |
name: Lint changed yaml files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get list of changed yaml files | |
id: changed-files | |
uses: tj-actions/changed-files@v45 | |
with: | |
# Required to correctly handle filenames containing non-alphanumeric | |
# characters | |
quotepath: "false" | |
files: | | |
**/*.yaml | |
- name: List all changed files | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
# Print each changed file on a newline | |
echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | |
- name: Run yamllint | |
run: | | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
# changed-files adds backslashes to non-ascii file names. We need to | |
# remove those backslashes before running yamllint | |
sanitized_file=$(echo "$file" | sed -e 's/\\//g') | |
# Run yamllint on the sanitized file path | |
yamllint "$sanitized_file" | |
done |