-
Notifications
You must be signed in to change notification settings - Fork 250
Open
Labels
Description
Objective
Introduce an OutputName semantic type in pkg/constants and apply it to the 10 untyped output name constants, providing compile-time protection against accidentally mixing output names with arbitrary strings.
Context
Discussion #17885 (Typist - Go Type Consistency Analysis) identified 10 untyped string constants for GitHub Actions output names that follow the same pattern as already-typed StepID and JobName constants in the same file.
Location
File: pkg/constants/constants.go (around lines 682–691)
// Current — untyped strings
const IsTeamMemberOutput = "is_team_member"
const StopTimeOkOutput = "stop_time_ok"
const SkipCheckOkOutput = "skip_check_ok"
const SkipNoMatchCheckOkOutput = "skip_no_match_check_ok"
const CommandPositionOkOutput = "command_position_ok"
const MatchedCommandOutput = "matched_command"
const RateLimitOkOutput = "rate_limit_ok"
const SkipRolesOkOutput = "skip_roles_ok"
const SkipBotsOkOutput = "skip_bots_ok"
const ActivatedOutput = "activated"
// Proposed — typed
type OutputName string
func (o OutputName) String() string { return string(o) }
const IsTeamMemberOutput OutputName = "is_team_member"
// ... etcApproach
- Add
type OutputName stringwithString()andIsValid()methods (consistent with other semantic types inpkg/constants) inpkg/constants/constants.go - Apply the type to all 10 output name constants
- Update the ~19 usage sites in
pkg/workflowandpkg/clito usestring(constant)or.String()where plain string is needed, or update function signatures to acceptOutputNamewhere appropriate
Files to Modify
pkg/constants/constants.go— addOutputNametype, apply to 10 constantspkg/workflow/*.go— update ~19 usage sitespkg/cli/*.go— update any usage sites
Acceptance Criteria
-
type OutputName stringdefined withString()andIsValid()methods - All 10 output name constants use the
OutputNametype - All usage sites compile correctly
-
make buildandmake test-unitpass -
make fmtandmake lintpass
Generated by Plan Command for issue #discussion #17885
- expires on Feb 25, 2026, 11:40 AM UTC
Reactions are currently unavailable