diff --git a/README.md b/README.md index 568de05..c9d40a4 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ This action supports additional arguments. Most are converted to parameters for | --format | format | yaml | | --include-path-params | include-path-params | false | | --exclude-elements | exclude-elements | '' | +| --filter-extension | filter-extension | '' | | --composed | composed | false | | N/A | output-to-file | '' | @@ -47,6 +48,7 @@ Additional arguments: | --deprecation-days-beta | deprecation-days-beta | 31 | | --deprecation-days-stable | deprecation-days-stable | 180 | | --exclude-elements | exclude-elements | '' | +| --filter-extension | filter-extension | '' | | --composed | composed | false | | N/A | output-to-file | '' | @@ -64,13 +66,14 @@ Copy and paste the following snippet into your build .yml file: Additional arguments: -| CLI | Action input | Default | -| ----------------------| ----------------------- | ------- | -| --include-path-params | include-path-params | false | -| --exclude-elements | exclude-elements | '' | -| --composed | composed | false | -| --prefix-base | prefix-base | '' | -| --prefix-revision | prefix-revision | '' | -| --case-insensitive-headers| case-insensitive-headers| false | -| --format | format | '' | -| N/A | output-to-file | '' | +| CLI | Action input | Default | +| -------------------------- | ------------------------ | ------- | +| --include-path-params | include-path-params | false | +| --exclude-elements | exclude-elements | '' | +| --filter-extension | filter-extension | '' | +| --composed | composed | false | +| --prefix-base | prefix-base | '' | +| --prefix-revision | prefix-revision | '' | +| --case-insensitive-headers | case-insensitive-headers | false | +| --format | format | '' | +| N/A | output-to-file | '' | diff --git a/breaking/action.yml b/breaking/action.yml index 350052e..9cdc217 100644 --- a/breaking/action.yml +++ b/breaking/action.yml @@ -28,6 +28,10 @@ inputs: description: 'Exclude certain kinds of changes' required: false default: '' + filter-extension: + description: 'Exclude paths and operations with an OpenAPI Extension matching the given regular expression' + required: false + default: '' composed: description: 'Run in composed mode' required: false @@ -51,5 +55,6 @@ runs: - ${{ inputs.deprecation-days-beta }} - ${{ inputs.deprecation-days-stable }} - ${{ inputs.exclude-elements }} + - ${{ inputs.filter-extension }} - ${{ inputs.composed }} - - ${{ inputs.output-to-file }} \ No newline at end of file + - ${{ inputs.output-to-file }} diff --git a/breaking/entrypoint.sh b/breaking/entrypoint.sh index 13b39ad..e8af227 100755 --- a/breaking/entrypoint.sh +++ b/breaking/entrypoint.sh @@ -9,8 +9,9 @@ readonly include_path_params="$5" readonly deprecation_days_beta="$6" readonly deprecation_days_stable="$7" readonly exclude_elements="$8" -readonly composed="$9" -readonly output_to_file="${10}" +readonly filter_extension="$9" +readonly composed="${10}" +readonly output_to_file="${11}" write_output () { _write_output_output="$1" @@ -32,7 +33,7 @@ write_output () { echo "$_write_output_output" >>"$GITHUB_OUTPUT" } -echo "running oasdiff breaking... base: $base, revision: $revision, fail_on: $fail_on, include_checks: $include_checks, include_path_params: $include_path_params, deprecation_days_beta: $deprecation_days_beta, deprecation_days_stable: $deprecation_days_stable, exclude_elements: $exclude_elements, composed: $composed, output_to_file: $output_to_file" +echo "running oasdiff breaking... base: $base, revision: $revision, fail_on: $fail_on, include_checks: $include_checks, include_path_params: $include_path_params, deprecation_days_beta: $deprecation_days_beta, deprecation_days_stable: $deprecation_days_stable, exclude_elements: $exclude_elements, filter_extension: $filter_extension, composed: $composed, output_to_file: $output_to_file" # Build flags to pass in command flags="" @@ -51,6 +52,9 @@ fi if [ -n "$exclude_elements" ]; then flags="$flags --exclude-elements $exclude_elements" fi +if [ -n "$filter_extension" ]; then + flags="$flags --filter-extension $filter_extension" +fi if [ "$composed" = "true" ]; then flags="$flags -c" fi diff --git a/changelog/action.yml b/changelog/action.yml index aa23fdc..a404e48 100644 --- a/changelog/action.yml +++ b/changelog/action.yml @@ -15,6 +15,10 @@ inputs: description: 'Exclude certain kinds of changes' required: false default: '' + filter-extension: + description: 'Exclude paths and operations with an OpenAPI Extension matching the given regular expression' + required: false + default: '' composed: description: 'Run in composed mode' required: false @@ -50,6 +54,7 @@ runs: - ${{ inputs.revision }} - ${{ inputs.include-path-params }} - ${{ inputs.exclude-elements }} + - ${{ inputs.filter-extension }} - ${{ inputs.composed }} - ${{ inputs.output-to-file }} - ${{ inputs.prefix-base }} diff --git a/changelog/entrypoint.sh b/changelog/entrypoint.sh index 9124dd2..9c29db6 100755 --- a/changelog/entrypoint.sh +++ b/changelog/entrypoint.sh @@ -24,14 +24,15 @@ readonly base="$1" readonly revision="$2" readonly include_path_params="$3" readonly exclude_elements="$4" -readonly composed="$5" -readonly output_to_file="$6" -readonly prefix_base="$7" -readonly prefix_revision="$8" -readonly case_insensitive_headers="$9" -readonly format="${10}" +readonly filter_extension="$5" +readonly composed="$6" +readonly output_to_file="$7" +readonly prefix_base="$8" +readonly prefix_revision="$9" +readonly case_insensitive_headers="${10}" +readonly format="${11}" -echo "running oasdiff changelog base: $base, revision: $revision, include_path_params: $include_path_params, exclude_elements: $exclude_elements, composed: $composed, output_to_file: $output_to_file, prefix_base: $prefix_base, prefix_revision: $prefix_revision, case_insensitive_headers: $case_insensitive_headers, format: $format" +echo "running oasdiff changelog base: $base, revision: $revision, include_path_params: $include_path_params, exclude_elements: $exclude_elements, filter_extension: $filter_extension, composed: $composed, output_to_file: $output_to_file, prefix_base: $prefix_base, prefix_revision: $prefix_revision, case_insensitive_headers: $case_insensitive_headers, format: $format" # Build flags to pass in command flags="" @@ -41,6 +42,9 @@ fi if [ -n "$exclude_elements" ]; then flags="$flags --exclude-elements $exclude_elements" fi +if [ -n "$filter_extension" ]; then + flags="$flags --filter-extension $filter_extension" +fi if [ "$composed" = "true" ]; then flags="$flags -c" fi diff --git a/diff/action.yml b/diff/action.yml index dbd1493..1aa1904 100644 --- a/diff/action.yml +++ b/diff/action.yml @@ -23,6 +23,10 @@ inputs: description: 'Exclude certain kinds of changes' required: false default: '' + filter-extension: + description: 'Exclude paths and operations with an OpenAPI Extension matching the given regular expression' + required: false + default: '' composed: description: 'Run in composed mode' required: false @@ -44,5 +48,6 @@ runs: - ${{ inputs.fail-on-diff }} - ${{ inputs.include-path-params }} - ${{ inputs.exclude-elements }} + - ${{ inputs.filter-extension }} - ${{ inputs.composed }} - ${{ inputs.output-to-file }} diff --git a/diff/entrypoint.sh b/diff/entrypoint.sh index f8c6e0e..dab4d0d 100755 --- a/diff/entrypoint.sh +++ b/diff/entrypoint.sh @@ -26,10 +26,11 @@ readonly format="$3" readonly fail_on_diff="$4" readonly include_path_params="$5" readonly exclude_elements="$6" -readonly composed="$7" -readonly output_to_file="$8" +readonly filter_extension="$7" +readonly composed="$8" +readonly output_to_file="$9" -echo "running oasdiff diff base: $base, revision: $revision, format: $format, fail_on_diff: $fail_on_diff, include_path_params: $include_path_params, exclude_elements: $exclude_elements, composed: $composed, output_to_file: $output_to_file" +echo "running oasdiff diff base: $base, revision: $revision, format: $format, fail_on_diff: $fail_on_diff, include_path_params: $include_path_params, exclude_elements: $exclude_elements, filter_extension: $filter_extension, composed: $composed, output_to_file: $output_to_file" # Build flags to pass in command flags="" @@ -45,6 +46,9 @@ fi if [ -n "$exclude_elements" ]; then flags="$flags --exclude-elements $exclude_elements" fi +if [ -n "$filter_extension" ]; then + flags="$flags --filter-extension $filter_extension" +fi if [ "$composed" = "true" ]; then flags="$flags -c" fi