-
Notifications
You must be signed in to change notification settings - Fork 41
38 lines (35 loc) · 1.26 KB
/
init.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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/[email protected]
- name: Initialize Repo
run: |
git config --local user.email "[email protected]"
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- <<EOF
Initialize template repository proper
Set package name to $pack_name
Set project name to $proj_name
Set modid to $modid
EOF
- name: Push changes
uses: ad-m/[email protected]
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}