Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 21 additions & 0 deletions cmd/tamis/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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")
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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
Expand Down
Loading