feat: validate action#116
Merged
Merged
Conversation
Per-finding PR annotations via --format githubactions, plus a notice with a free review-page link when findings are reported. Mirrors the shape of the breaking action: text run for findings count + step output, githubactions run for the annotations, fail-on-finding toggle defaulting to true. allow-external-refs defaults to true (matches oasdiff's binary default); set to false when validating untrusted specs to prevent SSRF. Outputs `findings` (numeric) so downstream steps can branch on it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Holding this PR until oasdiff v1.16.0 ships with the new |
The wrapper was written against an assumed boolean `fail-on-finding`; the shipped `oasdiff validate` (oasdiff #894) uses a severity threshold instead. - action.yml: replace `fail-on-finding` with `fail-on` (ERR/WARN/INFO, like the breaking action); expose findings plus error_count/warning_count/info_count. - entrypoint.sh: pass `--fail-on`, run `-f githubactions` for inline annotations (authoritative exit), parse the total for the `findings` output, and emit zero counts for a valid spec. - Dockerfile: FROM tufin/oasdiff:v1.16.0 (the release that ships validate). - test.yaml: jobs for a valid spec (0 findings), an invalid spec (fails), and the severity threshold (a warning passes by default, fails with --fail-on WARN). - specs: valid.yaml, invalid.yaml, validate-warning.yaml fixtures. - release.sh: include validate/Dockerfile in the oasdiff-pin bump list. - README: document the validate action. CI stays red until tufin/oasdiff:v1.16.0 is published; entrypoint logic verified locally against a build of oasdiff main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # .github/workflows/test.yaml
The validate action checks a single spec, so the free /review link (which needs a base/revision diff) would just hit the review wall. Remove the notice + step-summary block and the now-unused jq install. The per-finding annotations on the Files Changed tab (--format githubactions) and the findings / error_count / warning_count / info_count outputs are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
validate/action that runsoasdiff validateagainst an OpenAPI spec and emits per-finding PR annotations via--format githubactions.findings(numeric count) so downstream steps can branch on it.::notice::annotation plus aGITHUB_STEP_SUMMARYlink to the free review surface on oasdiff.com, mirroring the breaking action.fail-on-findingtoggle (defaulttrue) lets callers run in visibility-only mode without failing CI.allow-external-refstoggle (defaulttrue, matching oasdiff's binary default); set tofalsewhen validating untrusted specs to prevent SSRF.Test plan
info.version, expect 1 finding annotation oninfo:at the correct line, exit 1.fail-on-finding: falseon a spec with findings, expect annotations + step summary link, exit 0.allow-external-refs: falseon a spec with an external$ref, expect a finding annotation.outputs.findingsis the numeric count and downstreamif: steps.x.outputs.findings == '0'works.🤖 Generated with Claude Code