Skip to content

feat: validate action#116

Draft
reuvenharrison wants to merge 1 commit into
mainfrom
feat/validate-action
Draft

feat: validate action#116
reuvenharrison wants to merge 1 commit into
mainfrom
feat/validate-action

Conversation

@reuvenharrison
Copy link
Copy Markdown
Contributor

Summary

  • New validate/ action that runs oasdiff validate against an OpenAPI spec and emits per-finding PR annotations via --format githubactions.
  • Outputs findings (numeric count) so downstream steps can branch on it.
  • When findings are reported, emits a ::notice:: annotation plus a GITHUB_STEP_SUMMARY link to the free review surface on oasdiff.com, mirroring the breaking action.
  • fail-on-finding toggle (default true) lets callers run in visibility-only mode without failing CI.
  • allow-external-refs toggle (default true, matching oasdiff's binary default); set to false when validating untrusted specs to prevent SSRF.

Test plan

  • Run on a valid spec, expect 0 findings, exit 0, no annotations.
  • Run on a spec with a missing info.version, expect 1 finding annotation on info: at the correct line, exit 1.
  • Run with fail-on-finding: false on a spec with findings, expect annotations + step summary link, exit 0.
  • Run with allow-external-refs: false on a spec with an external $ref, expect a finding annotation.
  • Confirm outputs.findings is the numeric count and downstream if: steps.x.outputs.findings == '0' works.

🤖 Generated with Claude Code

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>
@reuvenharrison reuvenharrison marked this pull request as draft May 17, 2026 21:20
@reuvenharrison
Copy link
Copy Markdown
Contributor Author

Holding this PR until oasdiff v1.16.0 ships with the new validate subcommand (oasdiff #894). Once that release is tagged and tufin/oasdiff:v1.16.0 is published, I'll bump validate/Dockerfile to that tag and add CI tests matching the diff/breaking/changelog jobs (output assertion + output-to-file + fail-on-finding toggle + allow-external-refs toggle). As of v1.15.3, oasdiff validate does not exist, so the action would fail with 'unknown command' on every run.

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