name: Rector and Code Styling on: schedule: - cron: "0 12 * * 2,4" # Runs once every Tuesday and Thursday jobs: php-cs-fixer: name: Rector & PHP-CS-Fixer runs-on: ubuntu-latest steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - name: Validate composer.json and composer.lock uses: php-actions/composer@8a65f0d3c6a1d17ca4800491a40b5756a4c164f3 # v6 with: command: validate - name: Cache Composer Dependencies id: composer-cache uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5 with: path: ./src/vendor key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer- - run: | echo "MONTH=$(date '+%h')" >> ${GITHUB_ENV} mkdir cache mkdir cache/rector mkdir cache/rector-tests - name: Install Composer Dependencies if: steps.composer-cache.outputs.cache-hit != 'true' uses: php-actions/composer@8a65f0d3c6a1d17ca4800491a40b5756a4c164f3 # v6 with: php_version: 8.4 - name: Setup PHP uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2 with: php-version: 8.4 - name: Restore Rector Cache uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5 with: path: ./var/cache/rector key: ${{ env.MONTH }}-rector restore-keys: ${{ env.MONTH }}-rector - name: Restore CS-Fixer Cache uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5 with: path: .php-cs-fixer.cache key: ${{ env.MONTH }}-csfixer restore-keys: ${{ env.MONTH }}-csfixer - name: Run Rector run: | php src/vendor/bin/rector - name: Run PHP CS Fixer run: php src/vendor/bin/php-cs-fixer fix - name: Create a Pull Request uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8 with: title: Apply PHP Code Styling & Quality Changes commit-message: Apply PHP Code Styling & Quality Changes branch: rector-and-CS body: Automated run of PHP-CS-Fixer and Rector to ensure code styling, quality, and modern practices. delete-branch: true token: ${{ secrets.BOT_TOKEN }} committer: FOSSBilling Bot author: FOSSBilling Bot labels: skip-changelog