Skip to content

Commit 96c69a4

Browse files
authored
feat: add prefix, case-insensitive headers, and format inputs to action (#64)
1 parent c715fc9 commit 96c69a4

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ Copy and paste the following snippet into your build .yml file:
6464

6565
Additional arguments:
6666

67-
| CLI | Action input | Default |
68-
| --------------------- | ------------------- | ------- |
69-
| --include-path-params | include-path-params | false |
70-
| --exclude-elements | exclude-elements | '' |
71-
| --composed | composed | false |
72-
| N/A | output-to-file | '' |
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 | '' |

changelog/action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ inputs:
2323
description: 'Output to a file at the given path'
2424
required: false
2525
default: ''
26+
prefix-base:
27+
description: 'Prefix for base version'
28+
required: false
29+
default: ''
30+
prefix-revision:
31+
description: 'Prefix for revision version'
32+
required: false
33+
default: ''
34+
case-insensitive-headers:
35+
description: 'Case insensitive headers'
36+
required: false
37+
default: 'false'
38+
format:
39+
description: 'Output format'
40+
required: false
41+
default: ''
2642
outputs:
2743
changelog:
2844
description: 'Output summary of API changelog'
@@ -36,3 +52,7 @@ runs:
3652
- ${{ inputs.exclude-elements }}
3753
- ${{ inputs.composed }}
3854
- ${{ inputs.output-to-file }}
55+
- ${{ inputs.prefix-base }}
56+
- ${{ inputs.prefix-revision }}
57+
- ${{ inputs.case-insensitive-headers }}
58+
- ${{ inputs.format }}

changelog/entrypoint.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ readonly include_path_params="$3"
2626
readonly exclude_elements="$4"
2727
readonly composed="$5"
2828
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}"
2933

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"
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"
3135

3236
# Build flags to pass in command
3337
flags=""
@@ -40,6 +44,18 @@ fi
4044
if [ "$composed" = "true" ]; then
4145
flags="$flags -c"
4246
fi
47+
if [ -n "$prefix_base" ]; then
48+
flags="$flags --prefix-base $prefix_base"
49+
fi
50+
if [ -n "$prefix_revision" ]; then
51+
flags="$flags --prefix-revision $prefix_revision"
52+
fi
53+
if [ "$case_insensitive_headers" = "true" ]; then
54+
flags="$flags --case-insensitive-headers"
55+
fi
56+
if [ -n "$format" ]; then
57+
flags="$flags --format $format"
58+
fi
4359
echo "flags: $flags"
4460

4561
set -o pipefail

0 commit comments

Comments
 (0)