Weekly Pull Requests #2
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: 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: | |
# Don't run on forks. | |
if: github.repository == 'rectorphp/rector-src' | |
strategy: | |
fail-fast: false | |
matrix: | |
actions: | |
- | |
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: "Re-Generate Nodes/Rectors Documentation" | |
run: "composer docs" | |
branch: 'automated-regenerated-nodes-rectors-documentation' | |
name: ${{ matrix.actions.name }} | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN }} | |
# see https://github.com/shivammathur/setup-php | |
- | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
coverage: none | |
- uses: "ramsey/composer-install@v2" | |
- run: ${{ matrix.actions.run }} | |
# see https://github.com/peter-evans/create-pull-request | |
- | |
name: Create pull-request | |
uses: peter-evans/create-pull-request@v5 | |
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@v3 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: squash |