From 1b8cfb5563a812c013a9534593d9eaa3a4bc2e74 Mon Sep 17 00:00:00 2001 From: nea Date: Wed, 28 Jun 2023 12:53:08 +0200 Subject: Add template repository workflow --- .github/workflows/init.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/init.yml (limited to '.github/workflows/init.yml') diff --git a/.github/workflows/init.yml b/.github/workflows/init.yml new file mode 100644 index 0000000..c18810f --- /dev/null +++ b/.github/workflows/init.yml @@ -0,0 +1,38 @@ +name: Initialize Template Repo +on: + - push + +permissions: + contents: write + +jobs: + cleanup: + name: "Initialize Repo" + runs-on: ubuntu-latest + if: github.event.repository.name != 'Forge1.8.9Template' + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize Repo + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + owner=$(echo $GITHUB_REPOSITORY | cut -d/ -f1 | tr '[:upper:]' '[:lower:]') + name=$(echo $GITHUB_REPOSITORY | cut -d/ -f2 | tr '[:upper:]' '[:lower:]' | tr -d "-" | tr -d ".") + pack_name="com.github.${owner,,}.${name,,}" + proj_name="$(echo $GITHUB_REPOSITORY | cut -d/ -f2)" + modid="$(echo $name | sed 's/[^a-z]//g')" + ./make-my-own.sh "$pack_name" "$proj_name" "$modid" + git add . + git commit -F- <