Skip to content

Commit

Permalink
Merge pull request #14 from 10up/develop
Browse files Browse the repository at this point in the history
Merge change from develop to stable
  • Loading branch information
dinhtungdu authored Jun 15, 2022
2 parents 0716fe2 + 181e5b2 commit 0dd007d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.4] - 2022-06-14
### Added
- `EXTRA_ARGS` flag to support custom arguments (props [@dinhtungdu](https://github.com/dinhtungdu) via [#12](https://github.com/10up/wpcs-action/pull/12)).

## [1.3.3] - 2022-04-12
### Fixed
- Wrong branch used in examples.
Expand Down Expand Up @@ -32,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `phpcs_bin_path` and `installed_paths` options.

[Unreleased]: https://github.com/10up/wpcs-action/compare/stable...develop
[1.3.4]: https://github.com/10up/wpcs-action/compare/v1.3.3...v1.3.4
[1.3.3]: https://github.com/10up/wpcs-action/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/10up/wpcs-action/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/10up/wpcs-action/compare/v1.3.0...v1.3.1
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Available options (with default value):
repo_branch: 'master' # Branch of Standard repository
phpcs_bin_path: 'phpcs' # Custom PHPCS bin path
use_local_config: 'false' # Use local config if available
extra_args: '' # Extra arguments passing to the command
```
## Examples
Expand All @@ -77,6 +78,30 @@ jobs:
with:
standard: 'WordPress-VIP-Go'
```
### Display the linting result in the GitHub Actions summary
```yaml
name: WPCS check

on: pull_request

jobs:
phpcs:
name: VIPCS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: VIPCS check
uses: 10up/wpcs-action@stable
with:
standard: 'WordPress-VIP-Go'
extra_args: '--report-json=./phpcs.json'
- name: Update summary
run: |
npx --yes github:10up/phpcs-json-to-md --path ./phpcs.json --output ./phpcs.md
cat phpcs.md >> $GITHUB_STEP_SUMMARY
if: always()
```
## Support Level
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ inputs:
description: 'Use local config if available'
required: false
default: 'false'
extra_args:
description: 'Passing extra arguments to the phpcs command'
required: false
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ else
fi

if [ "${HAS_CONFIG}" = true ] && [ "${INPUT_USE_LOCAL_CONFIG}" = "true" ] ; then
${INPUT_PHPCS_BIN_PATH} ${WARNING_FLAG} --report=checkstyle
${INPUT_PHPCS_BIN_PATH} ${WARNING_FLAG} --report=checkstyle ${INPUT_EXTRA_ARGS}
else
${INPUT_PHPCS_BIN_PATH} ${WARNING_FLAG} --report=checkstyle --standard=${INPUT_STANDARD} --ignore=${EXCLUDES} --extensions=php ${INPUT_PATHS}
${INPUT_PHPCS_BIN_PATH} ${WARNING_FLAG} --report=checkstyle --standard=${INPUT_STANDARD} --ignore=${EXCLUDES} --extensions=php ${INPUT_PATHS} ${INPUT_EXTRA_ARGS}
fi

status=$?
Expand Down

0 comments on commit 0dd007d

Please sign in to comment.