Skip to content

Debugging code.

Debugging code. #1

Workflow file for this run

name: 'PHPCS'
on:
workflow_call:
secrets:
access-token:
description: 'GitHub Access Token'
required: true
inputs:
ref:
description: 'Git Commit Ref (branch, tag, or hash)'
required: true
type: string
php_version:
description: 'PHP Version'
required: false
type: string
default: '7.4'
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
# ------------------------------------------------------------------------------
# Prepare our cache directories
# ------------------------------------------------------------------------------
- name: Get Composer Cache Directory
id: get-composer-cache-dir
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
id: composer-cache
with:
path: ${{ steps.get-composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: "shivammathur/setup-php@v2"
with:
php-version: ${{ inputs.php_version }}
- uses: "ramsey/composer-install@v2"
- name: "Give permissions"
run: |
sudo chown -R root:root $GITHUB_WORKSPACE
# ------------------------------------------------------------------------------
# Get changed files
# ------------------------------------------------------------------------------
- name: Get list of changed files
id: files
run: |
echo "CHANGED_FILES=$(git diff --name-only --diff-filter=AM ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- . ':!tests' | grep '\.php$' | tr '\n' ' ')" >> $GITHUB_ENV
# ------------------------------------------------------------------------------
# PHPCS
# ------------------------------------------------------------------------------
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z]

Check failure on line 64 in .github/workflows/phpcs.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/phpcs.yml

Invalid workflow file

You have an error in your yaml syntax on line 64
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.access-token }}
run: |
# Check if there are any changed PHP files
if [ -z "${CHANGED_FILES}" ]; then
echo "No added or modified PHP files found."
exit 0
fi
echo "reached here"