Skip to content

Merge pull request #31 from happyprime/task/update-php-versions #4

Merge pull request #31 from happyprime/task/update-php-versions

Merge pull request #31 from happyprime/task/update-php-versions #4

Workflow file for this run

name: PHPStan

Check failure on line 1 in .github/workflows/phpstan.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/phpstan.yml

Invalid workflow file

(Line: 17, Col: 9): Unexpected value 'composer-auth-token', (Line: 17, Col: 9): Required property is missing: type
on:
workflow_call:
inputs:
php-version:
type: string
description: 'PHP version to use'
required: true
default: '8.3'
working-directory:
type: string
description: 'Working directory for the PHP project'
required: false
default: '.'
secrets:
composer-auth-token:
description: 'GitHub token for private Composer dependencies'
required: false
# The GITHUB_TOKEN used by Dependabot has read-only permissions
# by default, so we provide write permissions to this workflow
# so that comments can be left on the pull request.
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#changing-github_token-permissions
permissions:
contents: read
pull-requests: write
jobs:
phpstan:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: none
tools: composer
- name: Cache Composer
id: cache-composer
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v5
with:
path: ${{ steps.cache-composer.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles(format('{0}/composer.lock', inputs.working-directory)) }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
env:
COMPOSER_AUTH: ${{ secrets.composer-auth-token && format('{{"github-oauth":{{"github.com":"{0}"}}}}', secrets.composer-auth-token) || '' }}
run: |
composer install --prefer-dist --no-progress
- name: Detect coding standard violations
run: vendor/bin/phpstan analyse