-
-
Notifications
You must be signed in to change notification settings - Fork 155
62 lines (47 loc) · 1.82 KB
/
auto-regenerate.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
name: "Auto Regenerate"
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
auto-regenerate:
name: "Auto Regenerate"
runs-on: "ubuntu-24.04"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "8.3"
- name: "Check out salathe/phpdoc-base"
uses: "actions/checkout@v4"
with:
path: "generator/doc/doc-en/doc-base"
repository: "salathe/phpdoc-base"
- name: "Check out php/doc-en"
uses: "actions/checkout@v4"
with:
path: "generator/doc/doc-en/en"
repository: "php/doc-en"
- name: "Install dependencies with composer in generator/ directory"
run: "composer install --no-interaction"
working-directory: "generator"
- name: "Install dependencies with composer in root/ directory"
run: "composer install --no-interaction"
- name: "Dump autoloader with composer in root directory"
run: "composer dump-autoload"
- name: "Regenerate files"
id: regen
run: "./safe.php generate && git diff --exit-code && (echo regen=no-diff >> $GITHUB_OUTPUT) || (echo regen=diff >> $GITHUB_OUTPUT)"
working-directory: "generator"
- name: "Create a pr if the files are different"
if: "${{ steps.regen.outputs.regen == 'diff' }}"
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automatically regenerate the files"
branch: create-pull-request/regenerate-files
title: "Automatically regenerate the files"
labels: "regenerate, auto"
assignees: "shish, OskarStark, silasjoisten, moufmouf"