From 916e69c6c9f63172ab8070d130ce528fec5f2055 Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Wed, 16 Jul 2025 17:42:38 +0000 Subject: [PATCH 1/5] not recursively finding nested files --- .github/workflows/domain-replacer/replace.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/domain-replacer/replace.sh b/.github/workflows/domain-replacer/replace.sh index 6b971d30..5b2a08b1 100755 --- a/.github/workflows/domain-replacer/replace.sh +++ b/.github/workflows/domain-replacer/replace.sh @@ -8,6 +8,8 @@ echo "Scanning files matching: $GLOB_PATTERN" FILES=$(find . -type f \( -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name "*.txt" -o -name "*.py" \) ! -path "./.github/workflows/*") +echo "$FILES" + for file in $FILES; do if grep -q 'github.com/dell/' "$file"; then @@ -15,3 +17,4 @@ for file in $FILES; do sed -i 's|github.com/dell/|eos2git.cec.lab.emc.com/CSM/|g' "$file" fi done + From a98ac8331ace7cf88b5b1bbef09437ee01caf0a3 Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Wed, 16 Jul 2025 17:48:53 +0000 Subject: [PATCH 2/5] not recursively finding nested files --- .github/workflows/domain-replacer/replace.sh | 36 ++++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/domain-replacer/replace.sh b/.github/workflows/domain-replacer/replace.sh index 5b2a08b1..702d6b93 100755 --- a/.github/workflows/domain-replacer/replace.sh +++ b/.github/workflows/domain-replacer/replace.sh @@ -1,20 +1,42 @@ -#!/bin/bash -set -e +# #!/bin/bash +# set -e + +# GLOB_PATTERN="${1:-**/*.{md,yml,yaml,txt,py,go,sh}}" + +# echo "Scanning files matching: $GLOB_PATTERN" -GLOB_PATTERN="${1:-**/*.{md,yml,yaml,txt,py,go,sh}}" -echo "Scanning files matching: $GLOB_PATTERN" +# FILES=$(find . -type f \( -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name "*.txt" -o -name "*.py" \) ! -path "./.github/workflows/*") +# echo "$FILES" -FILES=$(find . -type f \( -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name "*.txt" -o -name "*.py" \) ! -path "./.github/workflows/*") -echo "$FILES" +# for file in $FILES; do +# if grep -q 'github.com/dell/' "$file"; then +# echo "Updating $file" +# sed -i 's|github.com/dell/|eos2git.cec.lab.emc.com/CSM/|g' "$file" +# fi +# done +#!/bin/bash +set -e -for file in $FILES; do +echo "Scanning for files to update..." + +find . -type f \( \ + -name "*.md" -o \ + -name "*.yml" -o \ + -name "*.yaml" -o \ + -name "*.txt" -o \ + -name "*.py" -o \ + -name "*.go" \ + -name "*.sh" \ +\) ! -path "./.github/workflows/*" | while read -r file; do if grep -q 'github.com/dell/' "$file"; then echo "Updating $file" sed -i 's|github.com/dell/|eos2git.cec.lab.emc.com/CSM/|g' "$file" fi done + + From 44130ba30248edd48938bdfba3d1fca46ab809c7 Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Wed, 16 Jul 2025 17:52:53 +0000 Subject: [PATCH 3/5] list all files traversed --- .github/workflows/domain-replacer/replace.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/domain-replacer/replace.sh b/.github/workflows/domain-replacer/replace.sh index 702d6b93..43dd7753 100755 --- a/.github/workflows/domain-replacer/replace.sh +++ b/.github/workflows/domain-replacer/replace.sh @@ -32,6 +32,7 @@ find . -type f \( \ -name "*.go" \ -name "*.sh" \ \) ! -path "./.github/workflows/*" | while read -r file; do + echo "Checking $file" if grep -q 'github.com/dell/' "$file"; then echo "Updating $file" sed -i 's|github.com/dell/|eos2git.cec.lab.emc.com/CSM/|g' "$file" From c2c46788483c877baccf823cdef81c662e185846 Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Wed, 16 Jul 2025 17:59:40 +0000 Subject: [PATCH 4/5] list all files traversed --- .github/workflows/actions.yaml | 4 ++-- .github/workflows/domain-replacer/action.yaml | 10 +++++----- .github/workflows/domain-replacer/replace.sh | 13 ++++--------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 510af8d2..2687e56c 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -37,8 +37,8 @@ jobs: - name: Run domain replacement uses: ./.github/workflows/domain-replacer - with: - file-glob: '**/*.{md,yml,yaml,txt,py,go,sh}' + # with: + # file-glob: '**/*.{md,yml,yaml,txt,py,go,sh}' - name: Show Git Diff run: git diff --stat || true diff --git a/.github/workflows/domain-replacer/action.yaml b/.github/workflows/domain-replacer/action.yaml index 7a73701a..7d714fd9 100644 --- a/.github/workflows/domain-replacer/action.yaml +++ b/.github/workflows/domain-replacer/action.yaml @@ -1,10 +1,10 @@ name: Replace External GitHub Domain description: Replaces https://github.com/dell/ with https://eos2git.cec.lab.emc.com/CSM/ -inputs: - file-glob: - description: 'Glob pattern for files to scan' - required: false - default: '**/*.{md,yml,yaml,txt,py,go,sh}' +# inputs: +# file-glob: +# description: 'Glob pattern for files to scan' +# required: false +# default: '**/*.{md,yml,yaml,txt,py,go,sh}' runs: using: "composite" diff --git a/.github/workflows/domain-replacer/replace.sh b/.github/workflows/domain-replacer/replace.sh index 43dd7753..ff78501b 100755 --- a/.github/workflows/domain-replacer/replace.sh +++ b/.github/workflows/domain-replacer/replace.sh @@ -23,15 +23,8 @@ set -e echo "Scanning for files to update..." -find . -type f \( \ - -name "*.md" -o \ - -name "*.yml" -o \ - -name "*.yaml" -o \ - -name "*.txt" -o \ - -name "*.py" -o \ - -name "*.go" \ - -name "*.sh" \ -\) ! -path "./.github/workflows/*" | while read -r file; do + +find . -type f ! -path "./.github/workflows/*" | while read -r file; do echo "Checking $file" if grep -q 'github.com/dell/' "$file"; then echo "Updating $file" @@ -39,5 +32,7 @@ find . -type f \( \ fi done +done + From dbe556a56520b709cc034b520637fb8bf0b93686 Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Wed, 16 Jul 2025 18:03:15 +0000 Subject: [PATCH 5/5] list all files traversed --- .github/workflows/domain-replacer/replace.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/domain-replacer/replace.sh b/.github/workflows/domain-replacer/replace.sh index ff78501b..5e4a33c1 100755 --- a/.github/workflows/domain-replacer/replace.sh +++ b/.github/workflows/domain-replacer/replace.sh @@ -32,7 +32,5 @@ find . -type f ! -path "./.github/workflows/*" | while read -r file; do fi done -done -