Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/domain-replacer/action.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
31 changes: 25 additions & 6 deletions .github/workflows/domain-replacer/replace.sh
Original file line number Diff line number Diff line change
@@ -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