rector/.github/workflows/weekly_pull_requests.yaml
Abdul Malik Ikhsan 9d37638fce
[GHA] Add automate regenerate preload.php weekly PR (#588)
* [GHA] Add automate regenerate preload.php weekly PR

* cs fix after preload

* no need space
2021-08-04 09:28:17 +02:00

75 lines
2.5 KiB
YAML

name: Weekly Pull Requests
on:
schedule:
# https://crontab.guru/once-a-week
- cron: "0 0 * * 0"
env:
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
COMPOSER_ROOT_VERSION: "dev-main"
jobs:
weekly_pull_requests:
strategy:
fail-fast: false
matrix:
actions:
-
name: "Re-Generate Nodes/Rectors Documentation"
run: "composer docs"
branch: 'automated-regenerated-nodes-rectors-documentation'
-
name: 'Apply Coding Standard'
run: "composer fix-cs"
branch: 'automated-apply-coding-standards'
-
name: 'Re-Generate preload.php'
run: "composer preload"
branch: 'automated-regenerated-preload'
name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
-
uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
# see https://github.com/shivammathur/setup-php
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
- uses: "ramsey/composer-install@v1"
- run: ${{ matrix.actions.run }}
# see https://github.com/peter-evans/create-pull-request
-
name: Create pull-request
uses: peter-evans/create-pull-request@v3
id: cpr
with:
token: ${{ secrets.ACCESS_TOKEN }}
commit-message: "[automated] ${{ matrix.actions.name }}"
base: 'main'
branch: ${{ matrix.actions.branch }}
title: '[automated] ${{ matrix.actions.name }}'
delete-branch: true
-
name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash