Skip to content

Commit

Permalink
Merge pull request #9 from swissspidy/fix/7
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Oct 31, 2023
2 parents c8fd8be + 3d9f6d0 commit ae19d64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The following inputs are supported:
**Note:** file annotations will still be made against the source files.
* `checks` (string): only run specific checks, separated by comma or newline.
* `categories` (string): only run checks from specific categories, separated by comma or newline.
* `exclude-directories` (string): additional directories to exclude from checks, separated by comma or newline.
By default, `.git`, `vendor` and `node_modules` directories are excluded.
* `ignore-warnings` (bool): ignore warnings.
* `ignore-errors` (bool): ignore errors.
* `include-experimental` (bool): include experimental checks.
Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
description: 'Limit checks to specific categories'
required: false
default: ''
exclude-directories:
description: 'Exclude certain directories from checks'
required: false
default: ''
ignore-warnings:
description: 'Ignore warnings'
required: false
Expand Down Expand Up @@ -103,13 +107,15 @@ runs:
run: |
CHECKS="${CHECKS//$'\n'/,}"
CATEGORIES="${CATEGORIES//$'\n'/,}"
ADDITIONAL_ARGS="$CHECKS $CATEGORIES $IGNORE_WARNINGS $IGNORE_ERRORS $INCLUDE_EXPERIMENTAL"
EXCLUDE_DIRS="${EXCLUDE_DIRS//$'\n'/,}"
ADDITIONAL_ARGS="$CHECKS $CATEGORIES $IGNORE_WARNINGS $IGNORE_ERRORS $INCLUDE_EXPERIMENTAL $EXCLUDE_DIRS"
wp-env run cli wp plugin list
wp-env run cli wp plugin check $PLUGIN_SLUG --format=json $ADDITIONAL_ARGS --require=./wp-content/plugins/plugin-check/cli.php > ${{ runner.temp }}/plugin-check-results.txt
shell: bash
env:
CHECKS: ${{ inputs.checks && format('--checks={0}', inputs.checks) || '' }}
CATEGORIES: ${{ inputs.categories && format('--categories={0}', inputs.categories) || '' }}
EXCLUDE_DIRS: ${{ inputs.exclude-directories && format('--exclude-directories={0}', inputs.exclude-directories) || '' }}
IGNORE_WARNINGS: ${{ inputs.ignore-warnings == 'true' && '--ignore-warnings' || '' }}
IGNORE_ERRORS: ${{ inputs.ignore-errors == 'true' && '--ignore-errors' || '' }}
INCLUDE_EXPERIMENTAL: ${{ inputs.include-experimental == 'true' && '--include-experimental' || '' }}
Expand Down

0 comments on commit ae19d64

Please sign in to comment.