Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added format support to the changelog mode #56

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alexeytokar
Copy link

No description provided.

@@ -66,6 +66,7 @@ Additional arguments:

| CLI | Action input | Default |
| --------------------- | ------------------- | ------- |
| --format | format | yaml |
Copy link

@jbergstroem jbergstroem Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think default should be the same as cli (text)


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would validate format here. I was actually about to open a PR that achieves the same where I did something like:

validate_format() {
  local -a output_formats=(githubactions html json junit markup singleline text yaml)
  for f in "${output_formats[@]}"; do
    [[ "${f}" == "${1}" ]] && return 0
  done
  return 1
}

validate_format $format || { echo "Invalid format: ${format}" >&2; exit 1; }

@jbergstroem
Copy link

Left some comments; I didn't check open PRs before I attempted to achieve the same. My commit is here: jbergstroem@22a8d89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants