Auto Regenerate #1571
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |