Skip to content
Merged
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
15 changes: 7 additions & 8 deletions .github/workflows/domain-replacer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
# Reusable workflow to update external GitHub domain references in files
name: domain-replacer

on:
workflow_dispatch:
# yamllint sees the below line as a true or false value instead of an 'on' trigger
on: # yamllint disable-line rule:truthy
workflow_call:

jobs:

replacedomain:
name: Scan for external GitHub domain
runs-on: ubuntu-latest
Expand All @@ -22,7 +24,7 @@ jobs:
uses: actions/checkout@v4

- name: Run domain replacement
uses: hoppea2/common-github-actions/domain-replacer@main
uses: ./domain-replacer

- name: Show Git Diff
run: git diff --stat || true
Expand All @@ -32,6 +34,7 @@ jobs:
git config user.name "github-actions"
git config user.email "github-actions@github.com"

# Check if the branch exists remotely
if git ls-remote --exit-code --heads origin domain-replacement; then
echo "Branch 'domain-replacement' exists. Checking it out."
git fetch origin domain-replacement
Expand All @@ -42,12 +45,10 @@ jobs:
fi

git add . ':!./.github/workflows/' ':!./.github/workflows/domain-replacer/'

if git diff --cached --quiet; then
echo "No changes to commit."
exit 0
fi

git commit -m "Replace external GitHub domain with internal Enterprise domain"
git pull --rebase origin domain-replacement || true
git push --force-with-lease origin domain-replacement
Expand All @@ -66,6 +67,4 @@ jobs:
--body "This PR replaces all references to github.com/dell/ with eos2git.cec.lab.emc.com/CSM/" \
--base main \
--head domain-replacement \
--repo ${{ github.repository }}


--repo ${{ github.repository }}