Skip to content

Commit d853d8a

Browse files
authored
feat: support filter extension (#61)
1 parent 96c69a4 commit d853d8a

File tree

7 files changed

+54
-24
lines changed

7 files changed

+54
-24
lines changed

README.md

Lines changed: 13 additions & 10 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

@@ -64,13 +66,14 @@ Copy and paste the following snippet into your build .yml file:
6466

6567
Additional arguments:
6668

67-
| CLI | Action input | Default |
68-
| ----------------------| ----------------------- | ------- |
69-
| --include-path-params | include-path-params | false |
70-
| --exclude-elements | exclude-elements | '' |
71-
| --composed | composed | false |
72-
| --prefix-base | prefix-base | '' |
73-
| --prefix-revision | prefix-revision | '' |
74-
| --case-insensitive-headers| case-insensitive-headers| false |
75-
| --format | format | '' |
76-
| N/A | output-to-file | '' |
69+
| CLI | Action input | Default |
70+
| -------------------------- | ------------------------ | ------- |
71+
| --include-path-params | include-path-params | false |
72+
| --exclude-elements | exclude-elements | '' |
73+
| --filter-extension | filter-extension | '' |
74+
| --composed | composed | false |
75+
| --prefix-base | prefix-base | '' |
76+
| --prefix-revision | prefix-revision | '' |
77+
| --case-insensitive-headers | case-insensitive-headers | false |
78+
| --format | format | '' |
79+
| 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
@@ -50,6 +54,7 @@ runs:
5054
- ${{ inputs.revision }}
5155
- ${{ inputs.include-path-params }}
5256
- ${{ inputs.exclude-elements }}
57+
- ${{ inputs.filter-extension }}
5358
- ${{ inputs.composed }}
5459
- ${{ inputs.output-to-file }}
5560
- ${{ inputs.prefix-base }}

changelog/entrypoint.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ 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"
29-
readonly prefix_base="$7"
30-
readonly prefix_revision="$8"
31-
readonly case_insensitive_headers="$9"
32-
readonly format="${10}"
27+
readonly filter_extension="$5"
28+
readonly composed="$6"
29+
readonly output_to_file="$7"
30+
readonly prefix_base="$8"
31+
readonly prefix_revision="$9"
32+
readonly case_insensitive_headers="${10}"
33+
readonly format="${11}"
3334

34-
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"
35+
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"
3536

3637
# Build flags to pass in command
3738
flags=""
@@ -41,6 +42,9 @@ fi
4142
if [ -n "$exclude_elements" ]; then
4243
flags="$flags --exclude-elements $exclude_elements"
4344
fi
45+
if [ -n "$filter_extension" ]; then
46+
flags="$flags --filter-extension $filter_extension"
47+
fi
4448
if [ "$composed" = "true" ]; then
4549
flags="$flags -c"
4650
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: 7 additions & 3 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

0 commit comments

Comments
 (0)