Skip to content

ci: add sanitizers github action #245

ci: add sanitizers github action

ci: add sanitizers github action #245

Workflow file for this run

# yamllint disable rule:line-length
---
name: Lint YAML files
on: # yamllint disable-line rule:truthy
pull_request:
branches: ['*']
jobs:
yamllint:
runs-on: ubuntu-latest
container:
image: dtors/base-cpp:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure Git Safe Directory
run: |
git config --global --add safe.directory $(pwd)
- name: Find affected files
run: |
git fetch origin ${{ github.base_ref }} --depth=1
git diff --name-only origin/${{ github.base_ref }} > affected_files.txt
echo "Affected files:"
cat affected_files.txt
- name: Find affected yaml files
run: |
> affected_yaml_files.txt
while read file; do
if [[ "$file" == *.yaml || "$file" == *.yml ]]; then
echo "$file" >> affected_yaml_files.txt
fi
done < affected_files.txt
sort -u affected_yaml_files.txt -o affected_yaml_files.txt
echo "Affected yaml files:"
cat affected_yaml_files.txt
echo "yaml_files=$(cat affected_yaml_files.txt | tr '\n' ' ')" >> $GITHUB_ENV
shell: bash
- name: Lint YAML files
if: env.yaml_files != ''
run: |-
yamllint ${yaml_files} || exit 1
- name: No yaml files affected
if: env.yaml_files == ''
run: echo "No affected yaml files found. Skipping yamllint."