-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (29 loc) · 1.27 KB
/
rename_template.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
---
name: Rename the template
on:
push:
permissions: write-all
jobs:
rename-template:
if: ${{ !contains(github.repository, 'template') }}
runs-on: ubuntu-22.04
steps:
- name: Check out the codebase
uses: actions/checkout@v4
- name: Set $REPOSITORY_NAME
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
shell: bash
- name: Set $REPOSITORY_URL
run: echo "REPOSITORY_URL=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
shell: bash
- name: Set $REPOSITORY_OWNER
run: echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV
shell: bash
- name: Rename the project
run: |
echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URL }}"
.github/workflows/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URL }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "✅ Ready to clone and code."
push_options: --force