Skip to content

Conversation

@alexeytokar
Copy link

No description provided.


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


# 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