Skip to content

Commit

Permalink
fix: fix workflow action didn't support crlf (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH committed Nov 21, 2023
1 parent 98942c0 commit 6effd05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/check_yaml_name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:
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_-]*$' "$file"; then
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"
cat $file
echo $file
exit 1
fi
done

0 comments on commit 6effd05

Please sign in to comment.