Skip to content

Commit 4007170

Browse files
committed
typo
1 parent 89928e9 commit 4007170

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

models/migrations/migrations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ var migrations = []Migration{
492492
// v256 -> v257
493493
NewMigration("Add is_internal column to package", v1_20.AddIsInternalColumnToPackage),
494494
// v257 -> v258
495-
NewMigration("Add varibale table", v1_20.CreateVariableTable),
495+
NewMigration("Add variable table", v1_20.CreateVariableTable),
496496
}
497497

498498
// GetCurrentDBVersion returns the current db version

models/variable/variable.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type ErrVariableInvalidValue struct {
4343

4444
func (err ErrVariableInvalidValue) Error() string {
4545
if err.Name != nil {
46-
return fmt.Sprintf("varibale name %s is invalid", *err.Name)
46+
return fmt.Sprintf("variable name %s is invalid", *err.Name)
4747
}
4848
if err.Data != nil {
4949
return fmt.Sprintf("variable data %s is invalid", *err.Data)
@@ -54,7 +54,7 @@ func (err ErrVariableInvalidValue) Error() string {
5454
// some regular expression of `variables`
5555
// reference to: https://docs.github.com/en/actions/learn-github-actions/variables#naming-conventions-for-configuration-variables
5656
var (
57-
varibaleNameReg = regexp.MustCompile("(?i)^[A-Z_][A-Z0-9_]*$")
57+
variableNameReg = regexp.MustCompile("(?i)^[A-Z_][A-Z0-9_]*$")
5858
variableForbiddenPrefixReg = regexp.MustCompile("(?i)^GIT(EA|HUB)_")
5959
)
6060

@@ -66,7 +66,7 @@ func (v *Variable) Validate() error {
6666
return ErrVariableInvalidValue{Name: &v.Name}
6767
case len(v.Data) == 0:
6868
return ErrVariableInvalidValue{Data: &v.Data}
69-
case !varibaleNameReg.MatchString(v.Name) || variableForbiddenPrefixReg.MatchString(v.Name):
69+
case !variableNameReg.MatchString(v.Name) || variableForbiddenPrefixReg.MatchString(v.Name):
7070
return ErrVariableInvalidValue{Name: &v.Name}
7171
default:
7272
return nil

0 commit comments

Comments
 (0)