-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (49 loc) · 1.55 KB
/
create_php_package.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
name: Create PHP Package
on:
pull_request:
types:
- closed
branches:
- 'main'
paths:
- 'php/**'
jobs:
create_php_package_and_push:
name: Create PHP package and push
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
- name: Define global config git
run: |
git config --global user.name "Github Actions"
git config --global user.email "[email protected]"
- name: Zip PHP files
run: |
zip -r ../php.zip php
- name: Move zip PHP file to workspace
run: |
mv ../php.zip .
- name: Push zip PHP file to new branch
run: |
git add php.zip
git commit -am "Added new PHP package: '${{ github.event.pull_request.title }}'"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
base: main
branch: feature/php-pr_${{ github.event.pull_request.number }}-${{ github.event.created_at }}
branch-suffix: timestamp
committer: 'Github Actions <[email protected]>'
author: 'Github Actions <[email protected]>'
title: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
labels: |
php
automated pr