-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (63 loc) · 2.31 KB
/
zeropoint-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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: 🧹 Remove ZeroPoint branding
on: workflow_dispatch
jobs:
rebrand:
runs-on: ubuntu-latest
if: github.repository != 'MWDelaney/ZeroPoint'
steps:
- name: Get current branch name
run: |
echo "branch=$(echo '${{ github.ref }}' | awk -F '/' '{print $3}')" >> $GITHUB_OUTPUT
shell: bash
id: getBranch
- name: Get to the owner of this repository
run: echo "owner=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_OUTPUT
shell: bash
id: getOwner
- name: Get the repository name and convert it to lowercase
run: echo "slug=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
shell: bash
id: getSlug
- name: Get the repository name
run: echo "name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_OUTPUT
shell: bash
id: getName
- name: Checkout the repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ steps.getBranch.outputs.branch }}
- name: Replace owner
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "MWDelaney"
replace: ${{ steps.getOwner.outputs.owner }}
regex: false
- name: Replace repository slug
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "ZeroPoint"
replace: ${{ steps.getName.outputs.name }}
regex: false
- name: Replace repository name
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "zeropoint"
replace: ${{ steps.getSlug.outputs.slug }}
regex: false
- name: Archive template README.md
uses: canastro/copy-file-action@master
with:
source: "README.md"
target: "README.template.md"
- name: Replace with project README.md
uses: canastro/copy-file-action@master
with:
source: "README.ZeroPoint.md"
target: "README.md"
- name: Commit changes and delete this workflow
uses: EndBug/add-and-commit@v9
with:
remove: '["./.github/workflows/zeropoint-template.yml"]'
message: "Up to zero 🪐"
tag: 'v1.0.0 --force'