Skip to content

Add Laravel Pulse, add Gitflow #46

Add Laravel Pulse, add Gitflow

Add Laravel Pulse, add Gitflow #46

Workflow file for this run

name: Inspections
on:
pull_request:
branches:
- "*"
jobs:
runPHPCSInspection:
name: Run PHP CS fixer on changes
runs-on: ubuntu-latest
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
tools: cs2pr, composer:v2, phpcs, php-cs-fixer:3
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Create Database
run: touch database/database.sqlite
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install
- name: Set up Git credentials
run: |
echo "machine github.com" >> ~/.netrc
echo "login github-actions[bot]" >> ~/.netrc
echo "password ${{ secrets.AUTH_ACCESS_TOKEN }}" >> ~/.netrc
git config --global credential.helper 'store --file ~/.netrc'
- name: Detect changes
id: changes
run: |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
FILES=$(curl -s -X GET -G -n $URL | jq -r '.[] | .filename' | xargs)
echo "::set-output name=files::$FILES"
- name: Fix violations
run: php-cs-fixer fix ${{ steps.changes.outputs.files }} --config=.php-cs-fixer.dist.php
- name: Set up Git credentials
run: |
git config user.name "weBot"
git config user.email "[email protected]"
git config --global credential.helper store
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }}