-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.43 KB
/
init.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
name: init package
on:
push:
branches: [ main ]
jobs:
init:
name: Init Package
runs-on: ubuntu-latest
# Only run this job when a repository has been created from the template, and it's an initial push (first commit)
if: github.repository != 'red-explosion/laravel-package-skeleton' && github.run_number == 1 && github.event.base_ref == null
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
- name: Init
run: php init.php "$PACKAGE_NAME" "$PACKAGE_DESCRIPTION" "$AUTHOR_NAME" "AUTHOR_USERNAME" "AUTHOR_EMAIL"
env:
PACKAGE_NAME: ${{ github.event.repository.name }}
PACKAGE_DESCRIPTION: ${{ github.event.repository.description }}
AUTHOR_NAME: ${{ github.event.commits[0].author.name }}
AUTHOR_USERNAME: ${{ github.actor }}
AUTHOR_EMAIL: ${{ github.event.pusher.email }}
- name: Delete init files
run: |
rm .github/workflows/init.yml
rm init.php
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: initialise project"