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 6b971d30..5e4a33c1 100755 --- a/.github/workflows/domain-replacer/replace.sh +++ b/.github/workflows/domain-replacer/replace.sh @@ -1,17 +1,36 @@ -#!/bin/bash -set -e +# #!/bin/bash +# set -e + +# 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/*") -GLOB_PATTERN="${1:-**/*.{md,yml,yaml,txt,py,go,sh}}" +# echo "$FILES" -echo "Scanning files matching: $GLOB_PATTERN" +# 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 -FILES=$(find . -type f \( -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name "*.txt" -o -name "*.py" \) ! -path "./.github/workflows/*") +#!/bin/bash +set -e + +echo "Scanning for files to update..." -for file in $FILES; 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" sed -i 's|github.com/dell/|eos2git.cec.lab.emc.com/CSM/|g' "$file" fi done + + +