-
Notifications
You must be signed in to change notification settings - Fork 0
/
workflow.yml
48 lines (42 loc) · 1.19 KB
/
workflow.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
# .github/workflows/init.yml
name: Initialize Template
#
# Run this on creation of a branch or ref
#
on:
push:
branches: main
jobs:
build:
#
# Check if this is not a commit to the template repository
#
if: github.repository != '{{ tmplr.repo_owner }}/{{ tmplr.repo_name }}'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
#
# Checkout the code
#
- uses: actions/checkout@v2
#
# Run tmplr with required environment variables,
# and remove the template recipe afterwards.
#
# If you want from GitHub Action contexts, add them here
# and set them as environment variables for tmplr.
#
- name: Apply template
run: npx tmplr && rm -fr .tmplr.yml && rm -fr .github/workflows/init.yml
env:
owner_name: ${{ github.event.repository.owner.name }}
owner_email: ${{ github.event.repository.owner.email }}
repo_name: ${{ github.event.repository.name }}
repo_url: ${{ github.event.repository.ssh_url }}
#
# Commit the code
#
- uses: EndBug/add-and-commit@v9
with:
message: Initialize from template