Added support for passing GITHUB_TOKEN

This commit is contained in:
Shubham Agrawal
2021-10-07 16:59:35 +05:30
parent 96d8f149da
commit 59bec2f619
2 changed files with 71 additions and 2 deletions

View File

@@ -11,9 +11,13 @@ import (
)
const (
workflowFile = "/tmp/workflow.yml"
webhookFile = "/tmp/webhook"
envFile = "/tmp/action.env"
secretFile = "/tmp/action.secrets"
workflowFile = "/tmp/workflow.yml"
)
var (
secrets = []string{"GITHUB_TOKEN"}
)
type (
@@ -42,11 +46,19 @@ func (p Plugin) Exec() error {
return err
}
if err := utils.CreateEnvAndSecretFile(envFile, secretFile, secrets); err != nil {
return err
}
cmdArgs := []string{
"-W",
workflowFile,
"-P",
fmt.Sprintf("ubuntu-latest=%s", p.Action.Image),
"--secret-file",
secretFile,
"--env-file",
envFile,
"-b",
"--detect-event",
}