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
5 changes: 0 additions & 5 deletions .github/workflows/domain-replacer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ name: domain-replacer

on:
workflow_call:
inputs:
replacement_domain:
required: true
type: string


jobs:
replacedomain:
Expand Down
13 changes: 10 additions & 3 deletions domain-replacer/action.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 }}

19 changes: 11 additions & 8 deletions domain-replacer/replace.sh
Original file line number Diff line number Diff line change
@@ -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