From bf64e387929e6f15e1a4c1300592e4f5c0be0d05 Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Tue, 22 Jul 2025 16:46:32 +0000 Subject: [PATCH] trying peter evans action --- .github/workflows/domain-replacer.yaml | 38 ++++++++++++++++---------- domain-replacer/action.yaml | 20 -------------- domain-replacer/replace.sh | 21 -------------- 3 files changed, 24 insertions(+), 55 deletions(-) delete mode 100644 domain-replacer/action.yaml delete mode 100644 domain-replacer/replace.sh diff --git a/.github/workflows/domain-replacer.yaml b/.github/workflows/domain-replacer.yaml index 06347e5c..1a59820c 100644 --- a/.github/workflows/domain-replacer.yaml +++ b/.github/workflows/domain-replacer.yaml @@ -64,18 +64,28 @@ jobs: git push --force-with-lease origin domain-replacement - - name: Install GitHub CLI - run: | - sudo apt-get update - sudo apt-get install -y gh + # - name: Install GitHub CLI + # run: | + # sudo apt-get update + # sudo apt-get install -y gh + + - name: Create Pull Request + uses: ghe-actions/peter-evans-create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Replace external GitHub domain with internal Enterprise domain + title: Replace external GitHub domain + body: This PR replaces all references to github.com/dell/ with eos2git.cec.lab.emc.com/CSM/ + branch: domain-replacement + base: main - - name: Create Pull Request with gh CLI - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr create \ - --title "Replace external GitHub domain" \ - --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 }} \ No newline at end of file + # - name: Create Pull Request with gh CLI + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # gh pr create \ + # --title "Replace external GitHub domain" \ + # --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 }} \ No newline at end of file diff --git a/domain-replacer/action.yaml b/domain-replacer/action.yaml deleted file mode 100644 index 8e342d67..00000000 --- a/domain-replacer/action.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# 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 the internal Enterprise domain in files. - -runs: - using: "composite" - steps: - - name: Run domain replacement script - shell: bash - run: | - chmod +x ${{ github.action_path }}/replace.sh - ${{ github.action_path }}/replace.sh "${{ inputs.file-glob }}" - \ No newline at end of file diff --git a/domain-replacer/replace.sh b/domain-replacer/replace.sh deleted file mode 100644 index e87b4e2a..00000000 --- a/domain-replacer/replace.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/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..." - -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/|eos2git.cec.lab.emc.com/CSM/|g' "$file" - fi -done \ No newline at end of file