-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (41 loc) · 1.35 KB
/
first-time-setup.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
name: first-time-setup
run-name: first time setup of repo
on:
# run when branch created (repo generated from template)
create:
# only keep latest run of this workflow
concurrency:
group: first-time-setup
cancel-in-progress: true
permissions:
actions: write
checks: write
contents: write
jobs:
first-time-setup:
# ensure run only once, when repo generated
if: github.run_number == 1
runs-on: ubuntu-latest
steps:
# get main branch repo contents
- name: Checkout code
uses: actions/checkout@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# remove files not needed for user instance of template
- name: Remove unneeded files
run: rm -f README.md renovate.json & rm -rf .github
# personalize readme for user
- name: Init readme
run: |
echo "
# ${{ github.event.repository.name }}
A minimalistic Express.js template for building APIs. This template provides a starting point for creating robust and scalable API projects using Express.js, a popular web framework for Node.js.
" > README.md
# save changed files
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Setup repo"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}