Skip to content

Commit

Permalink
fix: update input names
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed Apr 13, 2023
1 parent 7688787 commit fa0beeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ inputs:
dry-run:
description: 'Only attempt to delete, does not actaully delete the versions.'
required: false
default: 'true'
default: 'false'

outputs:
versions:
Expand Down
10 changes: 5 additions & 5 deletions pkg/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ func NewFromInputs(ctx context.Context, action *githubactions.Action) (*Action,
}
_ = os.Setenv("GITHUB_TOKEN", token)

packageName := githubactions.GetInput("package_name")
packageName := githubactions.GetInput("package-name")
if packageName == "" {
return nil, errors.New("missing parameter 'package_name'")
}

age := githubactions.GetInput("age")
versionMatch := githubactions.GetInput("version_match")
versionMatch := githubactions.GetInput("version-match")

if versionMatch == "" && age == "" {
return nil, errors.New("neither parameter 'age' nor 'version-match' set")
Expand All @@ -78,18 +78,18 @@ func NewFromInputs(ctx context.Context, action *githubactions.Action) (*Action,
ageDuration = &a
}

organizationName := strings.ToLower(githubactions.GetInput("organization_name"))
organizationName := strings.ToLower(githubactions.GetInput("organization-name"))
if organizationName == "" {
return nil, errors.New("missing parameter 'organization-name'")
}

packageType := githubactions.GetInput("package_type")
packageType := githubactions.GetInput("package-type")
if packageType == "" {
return nil, errors.New("missing parameter 'package-type'")
}

dryRun := false
if dryRunInput := githubactions.GetInput("dry_run"); dryRunInput != "" {
if dryRunInput := githubactions.GetInput("dry-run"); dryRunInput != "" {
dryRunParsed, err := strconv.ParseBool(dryRunInput)
if err != nil {
return nil, fmt.Errorf("invalid type for parameter 'dry-run' provided: %w", err)
Expand Down

0 comments on commit fa0beeb

Please sign in to comment.