Skip to content

Setting vendored_phpcs_path fails with chmod: Operation not permitted #4

Description

@td-sclemens

I created this action to add basic code sniffing for pull requests:

name: Code Sniffer
on:
pull_request:
jobs:
sniff:
name: Sniff changed files
runs-on: my-server
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: 8.2
memory_limit: -1
container_workdir: /app/www
command: install
args: --ignore-platform-reqs
- name: Get changed files
id: changed-files
run: echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
- name: Sniff changed files
uses: php-actions/phpcs@v1
with:
php_version: 8.2
vendored_phpcs_path: www/vendor/bin/phpcs
path: ${{ steps.changed-files.outputs.changed_files }}
standard: NameOfMyStandard

I liked the possibility to define your own phpcs binary, so the version defined in composer.json is used.

But it fails with this error:

chmod: changing permissions of '/home/runner/_work/name-of-my-project/name-of-my-project/www/vendor/bin/phpcs': Operation not permitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions