Skip to content

feat: add github output value - #219

Open
acouvreur wants to merge 1 commit into
santhosh-tekuri:boonfrom
acouvreur:boon
Open

feat: add github output value#219
acouvreur wants to merge 1 commit into
santhosh-tekuri:boonfrom
acouvreur:boon

Conversation

@acouvreur

Copy link
Copy Markdown

This feature allow users to output the validations errors as github error message using --output github.

This is very useful when this library is used as part of a validation tool in GitHub workflows.


This is a very naive, non-optimized way of setting the error on the file at the line that errored.

printGitHub uses the following behavior:

  1. Recursively prints the DetailedOutput
  2. If an error exists
    1. Convert the InstanceLocation to a JSON Path
    2. Use the gjson library to retrieve the index of the JSON Path from the JSON file
    3. Use that index to retrieve the line number (split by line ending and then find in which line the index belongs by summing each line length)

There's also no unit test, but it would need some for special cases, might work on that later.

@santhosh-tekuri
santhosh-tekuri force-pushed the boon branch 2 times, most recently from 3a6ebaa to 74428e2 Compare July 9, 2025 14:03
@santhosh-tekuri
santhosh-tekuri force-pushed the boon branch 3 times, most recently from 7ba9b5e to b0fc661 Compare June 28, 2026 17:38
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.

1 participant