diff --git a/.github/workflows/domain-replacer.yaml b/.github/workflows/domain-replacer.yaml index 9a628d94..ea07a90c 100644 --- a/.github/workflows/domain-replacer.yaml +++ b/.github/workflows/domain-replacer.yaml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 }} \ No newline at end of file