diff --git a/.github/workflows/domain-replacer.yaml b/.github/workflows/domain-replacer.yaml index dfc28604..cc207559 100644 --- a/.github/workflows/domain-replacer.yaml +++ b/.github/workflows/domain-replacer.yaml @@ -11,11 +11,6 @@ name: domain-replacer on: workflow_call: - inputs: - replacement_domain: - required: true - type: string - jobs: replacedomain: diff --git a/domain-replacer/action.yaml b/domain-replacer/action.yaml index 3896d8e7..8e342d67 100644 --- a/domain-replacer/action.yaml +++ b/domain-replacer/action.yaml @@ -1,5 +1,13 @@ +# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 + name: Replace External GitHub Domain -description: Replaces https://github.com/dell/ with https://eos2git.cec.lab.emc.com/CSM/ +description: Replaces https://github.com/dell/ with the internal Enterprise domain in files. runs: using: "composite" @@ -9,5 +17,4 @@ runs: run: | chmod +x ${{ github.action_path }}/replace.sh ${{ github.action_path }}/replace.sh "${{ inputs.file-glob }}" - env: - REPLACEMENT_DOMAIN: ${{ inputs.replacement-domain }} + \ No newline at end of file diff --git a/domain-replacer/replace.sh b/domain-replacer/replace.sh index 212810c2..e87b4e2a 100644 --- a/domain-replacer/replace.sh +++ b/domain-replacer/replace.sh @@ -1,18 +1,21 @@ #!/bin/bash + +# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 + set -e echo "Scanning for files to update..." -# Ensure REPLACEMENT_DOMAIN is set -if [ -z "$REPLACEMENT_DOMAIN" ]; then - echo "Error: REPLACEMENT_DOMAIN environment variable is not set." - exit 1 -fi - find . -type f ! -name "go.sum" | 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/|$REPLACEMENT_DOMAIN|g" "$file" + sed -i 's|github.com/dell/|eos2git.cec.lab.emc.com/CSM/|g' "$file" fi -done +done \ No newline at end of file