CasaOS-Store/.github/workflows/check_yaml_name.yml

29 lines
781 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: PR Check YAML
on:
pull_request:
types: [opened, synchronize]
jobs:
check_yaml:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Install dos2unix
# run: apt-get install dos2unix
- name: Check name field in YAML files
id: check_name
run: |
find . -type f \( -name "docker-compose.yaml" -or -name "docker-compose.yml" \) | while read -r file; do
if ! grep -qP '^name:\s[a-z0-9_-]*\r?$' "$file"; then
echo "There is a problem with the value of name in the submitted yaml, please make sure the value is in the range [a-z0-9_-]. And error file name$file"
echo $file
exit 1
fi
done