From 6effd055196690079509cc20ee9539342cb021dc Mon Sep 17 00:00:00 2001 From: CorrectRoadH Date: Tue, 21 Nov 2023 18:08:39 +0800 Subject: [PATCH] fix: fix workflow action didn't support crlf (#342) --- .github/workflows/check_yaml_name.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_yaml_name.yml b/.github/workflows/check_yaml_name.yml index 8860858..fb99b6a 100644 --- a/.github/workflows/check_yaml_name.yml +++ b/.github/workflows/check_yaml_name.yml @@ -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