Inconsistent Spectral Rule Behavior with Github Action

I have a working integration with the Spectral Github Action using a custom ruleset. I am having particular problems with a specific rule: operation-tag-defined. Code changes in an open api document that break this rule locally do not trigger a warning or error on the GitHub Action.

Other rules that are defined in my ruleset or extended from the OAS ruleset all work as expected, but I cannot trigger operation-tag-defined.

To reproduce:
I am extending the OAS rules to my custom ruleset by setting

extends: [[spectral:oas, off]]

and setting individual rules to true like

operation-tag-defined: true

The OpenAPI document changes that are inconsistent are breaking the operation-tag-defined rule.

This rule requires tags on operations are all defined in the global tags array. When I remove global tag definitions locally, spectral errors on the operation tag that is undefined. No warning or annotation is produced by the GitHub action.

I thought that maybe I am checking out a version of the OAS ruleset where the operation-tag-defined rule is not “recommended,” but Spectral Action is using v5.3 of Spectral, and the docs show that the rule is recommended.

Thanks for the help,

1 Like