diff --git a/action.yml b/action.yml index 379efed..f9e1a3e 100644 --- a/action.yml +++ b/action.yml @@ -7,7 +7,7 @@ branding: inputs: since: - description: Only advisories created after this date (2026-10-22 or RFC 3339) are triaged. Required with `comment: true` unless `advisory` is set, every advisory in triage otherwise. + description: "Only advisories created after this date (2026-10-22 or RFC 3339) are triaged. Required with `comment: true` unless `advisory` is set, every advisory in triage otherwise." required: false advisory: description: Triage this GHSA only, whatever its state and creation date. diff --git a/cmd/tamis/main_test.go b/cmd/tamis/main_test.go index d77a7cf..2790570 100644 --- a/cmd/tamis/main_test.go +++ b/cmd/tamis/main_test.go @@ -4,11 +4,13 @@ import ( "context" "io" "log/slog" + "os" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.yaml.in/yaml/v3" ) func TestParseSince(t *testing.T) { @@ -80,3 +82,22 @@ func TestRunValidatesConfiguration(t *testing.T) { }) } } + +// GitHub refuses to run an action whose manifest does not parse, with no test of its own to tell. +func TestActionManifestParses(t *testing.T) { + data, err := os.ReadFile("../../action.yml") + require.NoError(t, err) + var manifest struct { + Inputs map[string]struct { + Description string `yaml:"description"` + } `yaml:"inputs"` + } + + require.NoError(t, yaml.Unmarshal(data, &manifest)) + + require.NotEmpty(t, manifest.Inputs) + for name, input := range manifest.Inputs { + require.NotEmpty(t, input.Description, "the %s input lost its description", name) + } + require.Error(t, yaml.Unmarshal([]byte("inputs:\n since:\n description: Required with `comment: true` unless set.\n"), &manifest), "the test would not catch the colon that broke the manifest") +} diff --git a/go.mod b/go.mod index a295f57..d070c21 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/git-pkgs/cwe v0.1.1 github.com/openai/openai-go/v3 v3.85.1 github.com/stretchr/testify v1.12.1 + go.yaml.in/yaml/v3 v3.0.5 golang.org/x/sync v0.24.0 ) @@ -39,7 +40,6 @@ require ( go.opentelemetry.io/otel/log v1.47.0 // indirect go.opentelemetry.io/otel/metric v1.47.0 // indirect go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/mod v0.42.0 // indirect golang.org/x/sys v0.49.0 // indirect golang.org/x/term v0.47.0 // indirect