diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac83a89..900dcf3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,3 +23,13 @@ jobs: continue-on-error: true # Since we expect it to always fail for the test plugin. with: build-dir: 'build' + + - name: Run plugin check + uses: ./ + continue-on-error: true # Since we expect it to always fail for the test plugin. + with: + build-dir: 'build' + exclude-checks: | + late_escaping + plugin_readme + include-experimental: true diff --git a/README.md b/README.md index 0e9a2f0..13487b6 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,14 @@ See [action.yml](action.yml) # Default: '' checks: '' + # List of checks to exclude from running. + # Each check should be separated with new lines. + # Examples: i18n_usage, file_type, late_escaping. + # Applies after the `checks` input. + # + # Default: '' + exclude-checks: '' + # List of categories to limit checks to. # Each category should be separated with new lines. # Examples: general, security diff --git a/action.yml b/action.yml index 2d210bd..1c6e8b8 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,10 @@ inputs: description: 'Only run specific checks' required: false default: '' + exclude-checks: + description: 'Checks to exclude' + required: false + default: '' categories: description: 'Limit checks to specific categories' required: false @@ -106,14 +110,16 @@ runs: - name: Run Plugin Check run: | CHECKS="${CHECKS//$'\n'/,}" + EXCLUDE_CHECKS="${EXCLUDE_CHECKS//$'\n'/,}" CATEGORIES="${CATEGORIES//$'\n'/,}" EXCLUDE_DIRS="${EXCLUDE_DIRS//$'\n'/,}" - ADDITIONAL_ARGS="$CHECKS $CATEGORIES $IGNORE_WARNINGS $IGNORE_ERRORS $INCLUDE_EXPERIMENTAL $EXCLUDE_DIRS" + ADDITIONAL_ARGS="$CHECKS $EXCLUDE_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) || '' }} + EXCLUDE_CHECKS: ${{ inputs.exclude-checks && format('--exclude-checks={0}', inputs.exclude-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' || '' }}