From 68d067ee649f991cc80da4bc54a69d79ad67a7c7 Mon Sep 17 00:00:00 2001 From: TheDayIsMyEnemy <34052076+TheDayIsMyEnemy@users.noreply.github.com> Date: Sun, 25 Feb 2024 14:28:22 -0500 Subject: [PATCH] Update configure-new-repo.yml --- .github/workflows/configure-new-repo.yml | 30 +++++++++++------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/configure-new-repo.yml b/.github/workflows/configure-new-repo.yml index f02c59f..6e5a633 100644 --- a/.github/workflows/configure-new-repo.yml +++ b/.github/workflows/configure-new-repo.yml @@ -18,20 +18,18 @@ jobs: if: ${{ github.event.created && github.repository != 'TheDayIsMyEnemy/BlazorTemplate' }} steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + - run: | + old_name='BlazorTemplate' + new_name=${{ github.event.repository.name }} + find . -maxdepth 2 -type d -name "$old_name*" -exec bash -c 'mv "{}" "$(echo "{}" | sed -e "s/'"${old_name}"'/'"${new_name}"'/")"' \; + find . -maxdepth 5 -type f \( -name '*.sln' -o -name '*.csproj' -o -name '*.cshtml' -o -name '*.razor' -o -name '*.cs' -o -name '*.md' \) -exec bash -c 'mv "{}" "$(echo "{}" | sed -e "s/'"${old_name}"'/'"${new_name}"'/")"' \; + find . -type f \( -name '*.sln' -o -name '*.csproj' -o -name '*.cshtml' -o -name '*.razor' -o -name '*.cs' -o -name '*.md' \) -exec sed -i "s/$old_name/$new_name/g" {} + + rm .github/workflows/configure-new-repo.yml - - name: Update Project Structure - run: | - old_name='BlazorTemplate' - new_name=${{ github.event.repository.name }} - find . -maxdepth 2 -type d -name "$old_name*" -exec bash -c 'mv "{}" "$(echo "{}" | sed -e "s/'"${old_name}"'/'"${new_name}"'/")"' \; - find . -maxdepth 5 -type f \( -name '*.sln' -o -name '*.csproj' -o -name '*.cshtml' -o -name '*.razor' -o -name '*.cs' -o -name '*.md' \) -exec bash -c 'mv "{}" "$(echo "{}" | sed -e "s/'"${old_name}"'/'"${new_name}"'/")"' \; - find . -type f \( -name '*.sln' -o -name '*.csproj' -o -name '*.cshtml' -o -name '*.razor' -o -name '*.cs' -o -name '*.md' \) -exec sed -i "s/$old_name/$new_name/g" {} + - rm .github/workflows/configure-new-repo.yml - - - name: Commit and Push Changes - run: | - git add -A - git commit -m "Update project structure" - git push origin main --force + git config user.name github-actions + git config user.email github-actions@github.com + + git add -A + git commit -m "Update project structure" + git push