Fix: use INPUT
This commit is contained in:
parent
751aebda05
commit
2f5528a63e
1 changed files with 4 additions and 4 deletions
8
main.go
8
main.go
|
@ -20,7 +20,7 @@ import (
|
||||||
|
|
||||||
// Args provides plugin execution arguments.
|
// Args provides plugin execution arguments.
|
||||||
type Args struct {
|
type Args struct {
|
||||||
Folder string `required:"true" envconfig:"INPUTS_FOLDER"`
|
Folder string `required:"true" envconfig:"INPUT_FOLDER"`
|
||||||
SshKey string `envconfig:"INPUT_SSH_KEY"`
|
SshKey string `envconfig:"INPUT_SSH_KEY"`
|
||||||
GitRemote string `envconfig:"INPUT_GIT_REMOTE"`
|
GitRemote string `envconfig:"INPUT_GIT_REMOTE"`
|
||||||
GitBranch string `envconfig:"INPUT_GIT_BRANCH"`
|
GitBranch string `envconfig:"INPUT_GIT_BRANCH"`
|
||||||
|
@ -99,15 +99,15 @@ func checkArgs(args *Args) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.Token == "" || args.Username == "") && args.SshKey == "" {
|
if (args.Token == "" || args.Username == "") && args.SshKey == "" {
|
||||||
return errors.New("(INPUTS_TOKEN and INPUTS_USERNAME) or INPUTS_SSH_KEY is required!")
|
return errors.New("(INPUT_TOKEN and INPUT_USERNAME) or INPUT_SSH_KEY is required!")
|
||||||
}
|
}
|
||||||
|
|
||||||
if folderInfo, err := os.Stat(args.Folder); os.IsNotExist(err) || !folderInfo.IsDir() {
|
if folderInfo, err := os.Stat(args.Folder); os.IsNotExist(err) || !folderInfo.IsDir() {
|
||||||
return errors.New("INPUTS_FOLDER is not a folder!")
|
return errors.New("INPUT_FOLDER is not a folder!")
|
||||||
}
|
}
|
||||||
|
|
||||||
if args.GitRemote == "" && (args.GithubServerUrl == "" || args.GithubRepository == "") {
|
if args.GitRemote == "" && (args.GithubServerUrl == "" || args.GithubRepository == "") {
|
||||||
return errors.New("INPUTS_GIT_REMOTE is required!")
|
return errors.New("INPUT_GIT_REMOTE is required!")
|
||||||
}
|
}
|
||||||
|
|
||||||
if args.GitRemote == "" {
|
if args.GitRemote == "" {
|
||||||
|
|
Loading…
Reference in a new issue