-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (29 loc) · 1.04 KB
/
template-cleanup.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
# Based on https://github.com/JetBrains/intellij-platform-plugin-template/blob/main/.github/workflows/template-cleanup.yml
name: Template Cleanup
on:
push:
branches:
- main
jobs:
cleanup:
name: Cleanup
runs-on: ubuntu-latest
if: github.event.repository.name != 'sveltekit-quick-starter'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cleanup
run: |
# Replace Every %NAME% with the repository name
find . -type f -exec sed -i "s/%NAME%/${{ github.event.repository.name }}/g" {} +
# Move everything from .github/template-cleanup to the root
shopt -s dotglob
cp -R .github/template-cleanup/* .
# Remove the template cleanup workflow and the template-cleanup folder
rm -r .github/template-cleanup .github/workflows/template-cleanup.yml
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Template cleanup