Skip to content

Commit a5af935

Browse files
committed
feat: support filter extension
1 parent 1c611ff commit a5af935

File tree

7 files changed

+41
-11
lines changed

7 files changed

+41
-11
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This action supports additional arguments. Most are converted to parameters for
2424
| --format | format | yaml |
2525
| --include-path-params | include-path-params | false |
2626
| --exclude-elements | exclude-elements | '' |
27+
| --filter-extension | filter-extension | '' |
2728
| --composed | composed | false |
2829
| N/A | output-to-file | '' |
2930

@@ -47,6 +48,7 @@ Additional arguments:
4748
| --deprecation-days-beta | deprecation-days-beta | 31 |
4849
| --deprecation-days-stable | deprecation-days-stable | 180 |
4950
| --exclude-elements | exclude-elements | '' |
51+
| --filter-extension | filter-extension | '' |
5052
| --composed | composed | false |
5153
| N/A | output-to-file | '' |
5254

@@ -68,5 +70,6 @@ Additional arguments:
6870
| --------------------- | ------------------- | ------- |
6971
| --include-path-params | include-path-params | false |
7072
| --exclude-elements | exclude-elements | '' |
73+
| --filter-extension | filter-extension | '' |
7174
| --composed | composed | false |
7275
| N/A | output-to-file | '' |

breaking/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ inputs:
2828
description: 'Exclude certain kinds of changes'
2929
required: false
3030
default: ''
31+
filter-extension:
32+
description: 'Exclude paths and operations with an OpenAPI Extension matching the given regular expression'
33+
required: false
34+
default: ''
3135
composed:
3236
description: 'Run in composed mode'
3337
required: false
@@ -51,5 +55,6 @@ runs:
5155
- ${{ inputs.deprecation-days-beta }}
5256
- ${{ inputs.deprecation-days-stable }}
5357
- ${{ inputs.exclude-elements }}
58+
- ${{ inputs.filter-extension }}
5459
- ${{ inputs.composed }}
55-
- ${{ inputs.output-to-file }}
60+
- ${{ inputs.output-to-file }}

breaking/entrypoint.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ readonly include_path_params="$5"
99
readonly deprecation_days_beta="$6"
1010
readonly deprecation_days_stable="$7"
1111
readonly exclude_elements="$8"
12-
readonly composed="$9"
13-
readonly output_to_file="${10}"
12+
readonly filter_extension="$9"
13+
readonly composed="$10"
14+
readonly output_to_file="${11}"
1415

1516
write_output () {
1617
_write_output_output="$1"
@@ -32,7 +33,7 @@ write_output () {
3233
echo "$_write_output_output" >>"$GITHUB_OUTPUT"
3334
}
3435

35-
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"
36+
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"
3637

3738
# Build flags to pass in command
3839
flags=""
@@ -51,6 +52,9 @@ fi
5152
if [ -n "$exclude_elements" ]; then
5253
flags="$flags --exclude-elements $exclude_elements"
5354
fi
55+
if [ -n "$filter_extension" ]; then
56+
flags="$flags --filter-extension $filter_extension"
57+
fi
5458
if [ "$composed" = "true" ]; then
5559
flags="$flags -c"
5660
fi

changelog/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ inputs:
1515
description: 'Exclude certain kinds of changes'
1616
required: false
1717
default: ''
18+
filter-extension:
19+
description: 'Exclude paths and operations with an OpenAPI Extension matching the given regular expression'
20+
required: false
21+
default: ''
1822
composed:
1923
description: 'Run in composed mode'
2024
required: false
@@ -34,5 +38,6 @@ runs:
3438
- ${{ inputs.revision }}
3539
- ${{ inputs.include-path-params }}
3640
- ${{ inputs.exclude-elements }}
41+
- ${{ inputs.filter-extension }}
3742
- ${{ inputs.composed }}
3843
- ${{ inputs.output-to-file }}

changelog/entrypoint.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ readonly base="$1"
2424
readonly revision="$2"
2525
readonly include_path_params="$3"
2626
readonly exclude_elements="$4"
27-
readonly composed="$5"
28-
readonly output_to_file="$6"
27+
readonly filter_extension="$5"
28+
readonly composed="$6"
29+
readonly output_to_file="$7"
2930

30-
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"
31+
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"
3132

3233
# Build flags to pass in command
3334
flags=""
@@ -37,6 +38,9 @@ fi
3738
if [ -n "$exclude_elements" ]; then
3839
flags="$flags --exclude-elements $exclude_elements"
3940
fi
41+
if [ -n "$filter_extension" ]; then
42+
flags="$flags --filter-extension $filter_extension"
43+
fi
4044
if [ "$composed" = "true" ]; then
4145
flags="$flags -c"
4246
fi

diff/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ inputs:
2323
description: 'Exclude certain kinds of changes'
2424
required: false
2525
default: ''
26+
filter-extension:
27+
description: 'Exclude paths and operations with an OpenAPI Extension matching the given regular expression'
28+
required: false
29+
default: ''
2630
composed:
2731
description: 'Run in composed mode'
2832
required: false
@@ -44,5 +48,6 @@ runs:
4448
- ${{ inputs.fail-on-diff }}
4549
- ${{ inputs.include-path-params }}
4650
- ${{ inputs.exclude-elements }}
51+
- ${{ inputs.filter-extension }}
4752
- ${{ inputs.composed }}
4853
- ${{ inputs.output-to-file }}

diff/entrypoint.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ readonly format="$3"
2626
readonly fail_on_diff="$4"
2727
readonly include_path_params="$5"
2828
readonly exclude_elements="$6"
29-
readonly composed="$7"
30-
readonly output_to_file="$8"
29+
readonly filter_extension="$7"
30+
readonly composed="$8"
31+
readonly output_to_file="$9"
3132

32-
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"
33+
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"
3334

3435
# Build flags to pass in command
3536
flags=""
@@ -45,6 +46,9 @@ fi
4546
if [ -n "$exclude_elements" ]; then
4647
flags="$flags --exclude-elements $exclude_elements"
4748
fi
49+
if [ -n "$filter_extension" ]; then
50+
flags="$flags --filter-extension $filter_extension"
51+
fi
4852
if [ "$composed" = "true" ]; then
4953
flags="$flags -c"
5054
fi
@@ -74,4 +78,4 @@ else
7478
write_output "No changes"
7579
fi
7680

77-
echo "$delimiter" >>"$GITHUB_OUTPUT"
81+
echo "$delimiter" >>"$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)