Skip to content

Commit

Permalink
feature: pr_modified_files_only flag (#8)
Browse files Browse the repository at this point in the history
flag to limit analysis to modified files

closes #6
  • Loading branch information
piotrkwiecinski authored Nov 9, 2023
1 parent 6440422 commit 48f5808
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
| `ignore_errors_on_exit` | 0 | Ignoring errors when generating the exit code when set to `1` |
| `ignore_warnings_on_exit` | 0 | Ignoring warnings when generating the exit code when set to `1` |
| `ignore` | no value | A comma separated list of patterns to ignore files and directories |
| `pr_modified_files_only` | "true" | Restricts analysis to modified files in a pull request |

See [action.yml](./action.yml).

Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ inputs:
ignore:
description: "A comma separated list of patterns to ignore files and directories"
required: false
pr_modified_files_only:
description: "Restricts analysis to modified files in a pull request"
required: false
default: true
runs:
using: "composite"
steps:
Expand All @@ -68,7 +72,7 @@ runs:
GITHUB_TOKEN: ${{ github.token }}
INPUT_CODING_STANDARD_PACKAGE: ${{ inputs.coding_standard_package }}
INPUT_CODING_STANDARD_VERSION: ${{ inputs.coding_standard_version }}
if: ${{ inputs.install_coding_standard }}
if: inputs.install_coding_standard
run: ${{ github.action_path }}/src/install_coding_standard.bash
- name: Check if phpcs exists
shell: bash
Expand All @@ -81,7 +85,7 @@ runs:
shell: bash
id: pr-files
run: echo "files=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" >> $GITHUB_OUTPUT
if: github.event_name == 'pull_request'
if: inputs.pr_modified_files_only && github.event_name == 'pull_request'
- name: Running coding standard analysis
shell: bash
run: ${{ github.action_path }}/src/run_coding_standard.bash
Expand Down

0 comments on commit 48f5808

Please sign in to comment.