-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (31 loc) · 1.24 KB
/
init-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
name: Template Repository initialization
on:
push:
branches:
- master
env:
TEMPLATE_OWNER: idea2app
TEMPLATE_NAME: REST-Node-ts
REPOSITORY_OWNER: ${{ github.repository_owner }}
REPOSITORY_NAME: ${{ github.event.repository.name }}
jobs:
replace-repository-name:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@v4
- name: transform Repository variables to lower case
run: |
echo "REPOSITORY_OWNER=${REPOSITORY_OWNER@L}" >> "${GITHUB_ENV}"
echo "REPOSITORY_NAME=${REPOSITORY_NAME@L}" >> "${GITHUB_ENV}"
- if: github.repository != format('{0}/{1}', env.TEMPLATE_OWNER, env.TEMPLATE_NAME)
run: |
sh .github/workflows/replace-repository-name.sh \
${{ env.TEMPLATE_OWNER }} ${{ env.TEMPLATE_NAME }} \
${{ env.REPOSITORY_OWNER }} ${{ env.REPOSITORY_NAME }}
git checkout -- .github/workflows/init-template.yml
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[fix] replace Repository Name'