Skip to content
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ 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 |
| N/A | output-to-file | '' |
| 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 | '' |
20 changes: 20 additions & 0 deletions changelog/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ inputs:
description: 'Output to a file at the given path'
required: false
default: ''
prefix-base:
description: 'Prefix for base version'
required: false
default: ''
prefix-revision:
description: 'Prefix for revision version'
required: false
default: ''
case-insensitive-headers:
description: 'Case insensitive headers'
required: false
default: 'false'
format:
description: 'Output format'
required: false
default: ''
outputs:
changelog:
description: 'Output summary of API changelog'
Expand All @@ -36,3 +52,7 @@ runs:
- ${{ inputs.exclude-elements }}
- ${{ inputs.composed }}
- ${{ inputs.output-to-file }}
- ${{ inputs.prefix-base }}
- ${{ inputs.prefix-revision }}
- ${{ inputs.case-insensitive-headers }}
- ${{ inputs.format }}
18 changes: 17 additions & 1 deletion changelog/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ 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}"

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

# Build flags to pass in command
flags=""
Expand All @@ -40,6 +44,18 @@ fi
if [ "$composed" = "true" ]; then
flags="$flags -c"
fi
if [ -n "$prefix_base" ]; then
flags="$flags --prefix-base $prefix_base"
fi
if [ -n "$prefix_revision" ]; then
flags="$flags --prefix-revision $prefix_revision"
fi
if [ "$case_insensitive_headers" = "true" ]; then
flags="$flags --case-insensitive-headers"
fi
if [ -n "$format" ]; then
flags="$flags --format $format"
fi
echo "flags: $flags"

set -o pipefail
Expand Down
Loading