From ccf49f203342b5508e60f3791204afa1dab2eb80 Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 17 Sep 2024 19:26:53 +0300 Subject: [PATCH 1/2] feat: added format support to changelog mode --- changelog/action.yml | 5 +++++ changelog/entrypoint.sh | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/changelog/action.yml b/changelog/action.yml index 4fb32d3..4915ac8 100644 --- a/changelog/action.yml +++ b/changelog/action.yml @@ -7,6 +7,10 @@ inputs: revision: description: 'Path of revised OpenAPI spec in YAML or JSON format' required: true + format: + description: 'Output format' + required: false + default: 'yaml' include-path-params: description: 'Include path parameter names in endpoint matching' required: false @@ -32,6 +36,7 @@ runs: args: - ${{ inputs.base }} - ${{ inputs.revision }} + - ${{ inputs.format }} - ${{ inputs.include-path-params }} - ${{ inputs.exclude-elements }} - ${{ inputs.composed }} diff --git a/changelog/entrypoint.sh b/changelog/entrypoint.sh index 1b0767c..236e841 100755 --- a/changelog/entrypoint.sh +++ b/changelog/entrypoint.sh @@ -22,15 +22,19 @@ write_output () { readonly base="$1" readonly revision="$2" -readonly include_path_params="$3" -readonly exclude_elements="$4" -readonly composed="$5" -readonly output_to_file="$6" +readonly format="$3" +readonly include_path_params="$4" +readonly exclude_elements="$5" +readonly composed="$6" +readonly output_to_file="$7" 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" # Build flags to pass in command flags="" +if [ "$format" != "yaml" ]; then + flags="$flags --format $format" +fi if [ "$include_path_params" = "true" ]; then flags="$flags --include-path-params" fi From 95bf39cebf715bef8ff826b88e9fd9c12c3836c6 Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 17 Sep 2024 19:35:41 +0300 Subject: [PATCH 2/2] README fixed --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a868375..750019c 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Additional arguments: | CLI | Action input | Default | | --------------------- | ------------------- | ------- | +| --format | format | yaml | | --include-path-params | include-path-params | false | | --exclude-elements | exclude-elements | '' | | --composed | composed | false |