Skip to content

Commit

Permalink
[minor] Add "extensions" input and default to only .php files (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
permafrost06 authored Dec 13, 2024
1 parent 9283b48 commit 090cfe5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,21 @@ Select the test versions to run PHPCompatibility. It supports any format accepte

Paths to run compatibility check on. Default: `${{ github.workspace }}`

### extensions

Specify the extensions of the files that will be checked. Example: `extensions: php,inc,lib`. By default, it uses the options set by PHPCompatibility and PHP_CodeSniffer.

## Example Usage

```
uses: pantheon-systems/phpcompatibility-action@v1
with:
test-versions: 7.4-
paths: ${{ github.workspace }}/src
extensions: 'php,inc'
```

## Development

### Autotag
This project uses our [autotag action](https://github.com/pantheon-systems/action-autotag). New releases are created on each merge to `main`. See the [autotag readme](https://github.com/pantheon-systems/autotag?tab=readme-ov-file#usage) for details.
This project uses our [autotag action](https://github.com/pantheon-systems/action-autotag). New releases are created on each merge to `main`. See the [autotag readme](https://github.com/pantheon-systems/autotag?tab=readme-ov-file#usage) for details.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: 'Skip PHP Setup (useful if it was setup in another step)'
required: false
default: 'false'
extensions:
descriptions: 'Files only with this extension(s) will be tested'
required: false,
default: 'php'
runs:
using: 'composite'
steps:
Expand All @@ -29,3 +33,4 @@ runs:
env:
TEST_VERSIONS: ${{ inputs.test-versions }}
PATHS: ${{ inputs.paths }}
EXTENSIONS: ${{ inputs.extensions }}
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ composer install

export PATH=$PATH:$GITHUB_ACTION_PATH/vendor/bin

./vendor/bin/phpcs $PATHS --standard=PHPCompatibility --runtime-set testVersion $TEST_VERSIONS
./vendor/bin/phpcs --extensions=$EXTENSIONS $PATHS --standard=PHPCompatibility --runtime-set testVersion $TEST_VERSIONS

0 comments on commit 090cfe5

Please sign in to comment.